instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.icd9_code = "5185" | mimicsql_data |
CREATE TABLE table_50480 (
"Year" real,
"Competition" text,
"Venue" text,
"Position" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the venue of the race where Lineth Chepkurui placed 4th?
| SELECT "Venue" FROM table_50480 WHERE "Position" = '4th' | wikisql |
CREATE TABLE table_name_47 (
institutional_authority VARCHAR,
launch_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the institutional authority for launch date of october 12, 2004
| SELECT institutional_authority FROM table_name_47 WHERE launch_date = "october 12, 2004" | sql_create_context |
CREATE TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABLE genre (
g_name text,
rating text,
most_popular_in text
)
CREATE TABLE files (
f_id number,
artist_name text,
file_size text,
duration text,
formats text
)
CREATE TABL... | SELECT T1.artist_name, COUNT(*) FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name WHERE T2.languages = "english" GROUP BY T2.artist_name HAVING COUNT(*) >= 1 | spider |
CREATE TABLE table_6243 (
"Windows" text,
"Mac OS X" text,
"Linux" text,
"Other Unix" text,
"AmigaOS" text,
"Android" text,
"Windows Mobile" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Windows system has Windows Mobile of unknown, a... | SELECT "Windows" FROM table_6243 WHERE "Windows Mobile" = 'unknown' AND "Mac OS X" = 'yes' AND "Other Unix" = 'yes' AND "AmigaOS" = 'partial' | wikisql |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Road, AVG(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC | nvbench |
CREATE TABLE table_12213 (
"Name" text,
"GP-GS" text,
"Gain" real,
"Loss" real,
"Long" real,
"Avg/G" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total long for more than 24 loss, a gain over 273, and an avg/g of 207.8?
| SELECT SUM("Long") FROM table_12213 WHERE "Loss" > '24' AND "Gain" > '273' AND "Avg/G" = '207.8' | wikisql |
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.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.JZLSH = '22035367321' | css |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
... | SELECT COUNT(DISTINCT p.OwnerUserId) FROM Posts AS p INNER JOIN PostTags AS pt ON pt.TagId = @TagId WHERE pt.PostId = p.Id AND p.PostTypeId = 1 | sede |
CREATE TABLE table_name_6 (
round VARCHAR,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of rounds for gina carano
| SELECT COUNT(round) FROM table_name_6 WHERE opponent = "gina carano" | sql_create_context |
CREATE TABLE table_60493 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who placed t1 in Scotland?
| SELECT "Player" FROM table_60493 WHERE "Place" = 't1' AND "Country" = 'scotland' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "WIDOWED" AND procedures.short_title = "CV cath plcmt w guidance" | mimicsql_data |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | SELECT MED_SER_ORG_NO FROM t_kc21 WHERE PERSON_NM = '奚秀英' AND IN_HOSP_DATE BETWEEN '2010-06-16' AND '2015-04-16' GROUP BY MED_SER_ORG_NO ORDER BY COUNT(*) DESC LIMIT 1 | css |
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 Votes (
Id number,
PostId number,
VoteTypeId nu... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", u.Id AS "user_link", u.Reputation, COUNT(p.Id) AS "questions" FROM Users AS u INNER JOIN Posts AS p ON p.OwnerUserId = u.Id INNER JOIN PostTags AS pt ON pt.PostId = p.Id INNER JOIN Tags AS t ON t.Id = pt.TagId WHERE LOWER(Location) LIKE LOWER('%##countryname##... | sede |
CREATE TABLE table_21781578_2 (
us_viewers__millions_ VARCHAR,
directed_by VARCHAR,
production_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the number of US Viewers in the episode directed by Steve Shill and having a production code of E2... | SELECT us_viewers__millions_ FROM table_21781578_2 WHERE directed_by = "Steve Shill" AND production_code = "E2102" | sql_create_context |
CREATE TABLE table_68436 (
"Season" real,
"Date" text,
"Location" text,
"Race" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the place result of the downhill race before the 1996 season on 11-Mar-1995?
| SELECT "Place" FROM table_68436 WHERE "Race" = 'downhill' AND "Season" < '1996' AND "Date" = '11-mar-1995' | wikisql |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.admityear < "2138" | mimicsql_data |
CREATE TABLE table_42134 (
"Name" text,
"Main span metres" text,
"Main span feet" text,
"Year to open" real,
"Country" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Year to Open for the Dandeung Bridge?
| SELECT COUNT("Year to open") FROM table_42134 WHERE "Name" = 'dandeung bridge' | wikisql |
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 SUM(t_kc22.AMOUNT) FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_NM = '沈文乐' AND t_kc22.t_kc21_CLINIC_TYPE = '门诊' AND t_kc22.STA_DATE BETWEEN '2004-10-30' AND '2012-03-27' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE compartment_cla... | SELECT DISTINCT class_of_service.booking_class FROM class_of_service, fare, fare_basis, flight, flight_fare WHERE fare_basis.booking_class = class_of_service.booking_class AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'DL' AND flight.flight_id = f... | atis |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemics... | SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'vasopressors - epinephrine <= 0.1 microg... | eicu |
CREATE TABLE table_15767 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the To par for leland gibson
| SELECT "To par" FROM table_15767 WHERE "Player" = 'leland gibson' | wikisql |
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,... | SELECT *, COUNT(*) FROM (SELECT DATE(CAST(TIME_TO_STR(CreationDate, '%Y') AS TEXT) + '-' + CAST(TIME_TO_STR(CreationDate, '%m') AS TEXT) + '-01') AS Month, t.TagName FROM (SELECT p.Id, p.CreationDate FROM Posts AS p JOIN PostTags AS pt ON pt.PostId = p.Id JOIN Tags AS t ON t.Id = pt.TagId) AS pp JOIN PostTags AS pt ON ... | sede |
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.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name DESC | nvbench |
CREATE TABLE table_204_561 (
id number,
"fence" number,
"name" text,
"jockey" text,
"age" number,
"handicap (st-lb)" text,
"starting price" text,
"fate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which jockey rode his horse named maj... | SELECT "jockey" FROM table_204_561 WHERE "name" = 'major hitch' | squall |
CREATE TABLE table_46784 (
"Game" text,
"Date" text,
"Opponent" text,
"Score" text,
"Location/Attendance" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record is dated Dec 10?
| SELECT "Record" FROM table_46784 WHERE "Date" = 'dec 10' | wikisql |
CREATE TABLE table_3496 (
"Institution" text,
"Location" text,
"Founded" real,
"Type" text,
"Enrollment" text,
"Nickname" text,
"Joined" text,
"Left" text,
"Football Conference" text,
"Primary Conference" text
)
-- Using valid SQLite, answer the following questions for the tabl... | SELECT "Enrollment" FROM table_3496 WHERE "Location" = 'Westfield, Massachusetts' | wikisql |
CREATE TABLE table_name_24 (
venue VARCHAR,
opponent VARCHAR,
result VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Opponent of kilmarnock, and a Result of 1 1 happened in what venue?
| SELECT venue FROM table_name_24 WHERE opponent = "kilmarnock" AND result = "1–1" | sql_create_context |
CREATE TABLE table_60607 (
"Official Name" text,
"Status" text,
"Area km 2" real,
"Population" real,
"Census Ranking" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much Area km 2 have a Population of 1,215?
| SELECT COUNT("Area km 2") FROM table_60607 WHERE "Population" = '1,215' | wikisql |
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code tex... | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-47576' AND patient.hospitaldischargetime IS NULL)) AND medication.drug... | eicu |
CREATE TABLE table_name_8 (
country VARCHAR,
city VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country is Bandar Abbas in?
| SELECT country FROM table_name_8 WHERE city = "bandar abbas" | sql_create_context |
CREATE TABLE table_name_16 (
money___$__ VARCHAR,
player VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much money did David Toms get?
| SELECT money___$__ FROM table_name_16 WHERE player = "david toms" | sql_create_context |
CREATE TABLE table_12570207_1 (
total_region INTEGER,
fitzroy VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the maximum total region with fitzroy being 8047
| SELECT MAX(total_region) FROM table_12570207_1 WHERE fitzroy = 8047 | sql_create_context |
CREATE TABLE table_20174050_1 (
title VARCHAR,
story__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the title of the audio book with story number 91?
| SELECT title FROM table_20174050_1 WHERE story__number = 91 | sql_create_context |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total real
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year... | SELECT Position, AVG(Points) FROM player GROUP BY Position ORDER BY AVG(Points) DESC | nvbench |
CREATE TABLE table_23829490_1 (
media_type VARCHAR,
genre VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is every media type for the World genre?
| SELECT media_type FROM table_23829490_1 WHERE genre = "World" | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Episodic mood disord NOS" AND prescriptions.drug_type = "BASE" | mimicsql_data |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Cellulitis and abscess of leg, except foot" AND prescriptions.route = "PO" | mimicsql_data |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
C... | SELECT demographic.dob, demographic.admittime FROM demographic WHERE demographic.name = "Jerry Deberry" | mimicsql_data |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.icd9_code = "1173" AND lab.fluid = "Urine" | mimicsql_data |
CREATE TABLE table_name_18 (
college_team VARCHAR,
round VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is College/Team, when Round is less than 2, and when Nationality is 'United States'?
| SELECT college_team FROM table_name_18 WHERE round < 2 AND nationality = "united states" | sql_create_context |
CREATE TABLE table_20820 (
"Gun" text,
"m/v ft/s" real,
"Shell (lb)" text,
"Time to ft (m) at 25\u00b0 (seconds)" text,
"Time to ft (m) at 40\u00b0 (seconds)" text,
"Time to ft (m) at 55\u00b0 (seconds)" text,
"Max. height (ft)" real
)
-- Using valid SQLite, answer the following questions ... | SELECT MIN("m/v ft/s") FROM table_20820 WHERE "Max. height (ft)" = '23500' | wikisql |
CREATE TABLE table_name_32 (
model_number VARCHAR,
order_part_number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which model number has an order part number of TMDML44BKX5LD?
| SELECT model_number FROM table_name_32 WHERE order_part_number = "tmdml44bkx5ld" | sql_create_context |
CREATE TABLE table_59143 (
"Event" text,
"Time" text,
"Swimmer" text,
"School" text,
"Year" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is School, when Event is '100 Backstroke'?
| SELECT "School" FROM table_59143 WHERE "Event" = '100 backstroke' | wikisql |
CREATE TABLE vehicles (
vehicle_id number,
vehicle_details text
)
CREATE TABLE staff (
staff_id number,
staff_address_id number,
nickname text,
first_name text,
middle_name text,
last_name text,
date_of_birth time,
date_joined_staff time,
date_left_staff time
)
CREATE TABLE... | SELECT vehicle_details FROM vehicles WHERE vehicle_id = 1 | spider |
CREATE TABLE table_name_48 (
team VARCHAR,
competition VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the team for victorian football league
| SELECT team FROM table_name_48 WHERE competition = "victorian football league" | 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 d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE tra... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'reticulocyte count, automated') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 5561) | mimic_iii |
CREATE TABLE Guests (
guest_first_name VARCHAR,
guest_last_name VARCHAR,
guest_id VARCHAR
)
CREATE TABLE Apartment_Bookings (
guest_id VARCHAR,
booking_status_code VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the first names and last name... | SELECT T2.guest_first_name, T2.guest_last_name FROM Apartment_Bookings AS T1 JOIN Guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" | sql_create_context |
CREATE TABLE table_11964047_9 (
leading_scorer VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what's the leading scorer on march 2
| SELECT leading_scorer FROM table_11964047_9 WHERE date = "March 2" | sql_create_context |
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.Price, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name | nvbench |
CREATE TABLE table_203_629 (
id number,
"year" number,
"title" text,
"lead vocalist" text,
"aria chart position" number,
"album" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how long did they produce singles ?
| SELECT MAX("year") - MIN("year") FROM table_203_629 | squall |
CREATE TABLE table_name_15 (
facility_id INTEGER,
city_of_license VARCHAR,
erp___power_w VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Facility ID has a City of license of springfield, ma, and a ERP / Power W smaller than 230?
| SELECT MAX(facility_id) FROM table_name_15 WHERE city_of_license = "springfield, ma" AND erp___power_w < 230 | sql_create_context |
CREATE TABLE table_name_8 (
Id VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the 2006 value with 3r in 2007?
| SELECT 2006 FROM table_name_8 WHERE 2007 = "3r" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
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 numbe... | 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 = 19352)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi... | mimic_iii |
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE program_course (
program_id int,
course_id int,
workload int,
category varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program_requirement (
program_id int,
catego... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
... | SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65569) AND microbiologyevents.spec_type_desc = 'blood culture' AND NOT microbiologyevents.org_name IS NULL ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
... | SELECT demographic.diagnosis, lab.label FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE table_11160 (
"Date" text,
"Venue" text,
"Result" text,
"Win/ Loss/ Draw" text,
"Competition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When was the result 3-1?
| SELECT "Date" FROM table_11160 WHERE "Result" = '3-1' | wikisql |
CREATE TABLE table_name_50 (
goals INTEGER,
transfer_fee VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the largest goal number when the transfer fee was 0.8m?
| SELECT MAX(goals) FROM table_name_50 WHERE transfer_fee = "£0.8m" | sql_create_context |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE lives_in (
stuid number,
dormid number,
room_number number
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE dorm (
dormid number,
dorm_name text,
student_capacity number,
ge... | SELECT T1.amenity_name FROM dorm_amenity AS T1 JOIN has_amenity AS T2 ON T2.amenid = T1.amenid JOIN dorm AS T3 ON T2.dormid = T3.dormid WHERE T3.dorm_name = 'Anonymous Donor Hall' ORDER BY T1.amenity_name | spider |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | WITH USER_BY_TAG AS (SELECT ROW_NUMBER() OVER (ORDER BY COUNT(*) DESC) AS Rank, u.Id AS "user_link", COUNT(*) AS UpVotes FROM Tags AS t INNER JOIN PostTags AS pt ON pt.TagId = t.Id INNER JOIN Posts AS p ON p.ParentId = pt.PostId INNER JOIN Votes AS v ON v.PostId = p.Id AND VoteTypeId = 2 INNER JOIN Users AS u ON u.Id =... | sede |
CREATE TABLE table_8968 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the match lasted 2:16 how was it decided?
| SELECT "Method" FROM table_8968 WHERE "Time" = '2:16' | wikisql |
CREATE TABLE table_204_952 (
id number,
"rank" number,
"player" text,
"county" text,
"tally" text,
"total" number,
"opposition" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who ranked above mark corrigan ?
| SELECT "player" FROM table_204_952 WHERE "rank" = (SELECT "rank" FROM table_204_952 WHERE "player" = 'mark corrigan') - 1 | squall |
CREATE TABLE patients (
row_id number,
subject_id number,
gender text,
dob time,
dod time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location te... | SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_71796 (
"Manager" text,
"Years" text,
"Games" real,
"Wins" real,
"Losses" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average of games that were one in 1978 that were smaller than 141?
| SELECT AVG("Wins") FROM table_71796 WHERE "Years" = '1978' AND "Games" < '141' | wikisql |
CREATE TABLE table_14850099_18 (
burmese VARCHAR,
english VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Burmese term for Thursday?
| SELECT burmese FROM table_14850099_18 WHERE english = "Thursday" | sql_create_context |
CREATE TABLE table_5283 (
"Rider" text,
"Bike" text,
"Laps" real,
"Time" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the lowest grid with laps larger than 23?
| SELECT MIN("Grid") FROM table_5283 WHERE "Laps" > '23' | wikisql |
CREATE TABLE pilot (
Pilot_name VARCHAR,
pilot_ID VARCHAR
)
CREATE TABLE pilot_record (
pilot_ID VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the names of pilots and the number of records they have.
| SELECT T2.Pilot_name, COUNT(*) FROM pilot_record AS T1 JOIN pilot AS T2 ON T1.pilot_ID = T2.pilot_ID GROUP BY T2.Pilot_name | sql_create_context |
CREATE TABLE university (
School_ID int,
School text,
Location text,
Founded real,
Affiliation text,
Enrollment real,
Nickname text,
Primary_conference text
)
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Per... | SELECT ACC_Regular_Season, School_ID FROM basketball_match ORDER BY ACC_Regular_Season DESC | nvbench |
CREATE TABLE table_74401 (
"Date" text,
"Time" text,
"ACC Team" text,
"Big Ten Team" text,
"Location" text,
"Television" text,
"Attendance" real,
"Winner" text,
"Challenge Leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Where ... | SELECT "Location" FROM table_74401 WHERE "ACC Team" = 'Wake Forest' | wikisql |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - vancomycin' AND DATET... | eicu |
CREATE TABLE table_22858 (
"Model" text,
"Year" text,
"Code name" text,
"Fab ( nm )" real,
"Bus interface" text,
"Transistor count (Millions)" real,
"Memory max ( MiB )" text,
"Core ( MHz )" real,
"Memory ( MHz )" text,
"Type" text,
"Bus Width ( Bit )" real,
"DirectX" tex... | SELECT "DirectX" FROM table_22858 WHERE "Code name" = 'RV770 PRO' AND "Core ( MHz )" > '650.0' | wikisql |
CREATE TABLE table_21458142_1 (
sales_breakdown VARCHAR,
publisher VARCHAR,
title VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the sales breakdown for Nintendo's Mario Kart DS?
| SELECT sales_breakdown FROM table_21458142_1 WHERE publisher = "Nintendo" AND title = "Mario Kart DS" | sql_create_context |
CREATE TABLE table_26021 (
"Series #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (in millions)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the original air date of the episode t... | SELECT "Original air date" FROM table_26021 WHERE "Directed by" = 'David Paymer' | wikisql |
CREATE TABLE table_12429 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date has Opponents of sun shengnan han xinyun?
| SELECT "Date" FROM table_12429 WHERE "Opponents" = 'sun shengnan han xinyun' | wikisql |
CREATE TABLE table_6058 (
"Functions" text,
"s Default argument" text,
"Lambda functions" text,
"eval function" text,
"Pseudorandom number generation" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lambda function without a pseudorandom ... | SELECT "Lambda functions" FROM table_6058 WHERE "Pseudorandom number generation" = 'no' AND "s Default argument" = 'no' AND "Functions" = 'no' AND "eval function" = 'no' | wikisql |
CREATE TABLE table_204_722 (
id number,
"season" text,
"series" text,
"team" text,
"races" number,
"wins" number,
"poles" number,
"f/lap" number,
"podiums" number,
"points" number,
"position" text
)
-- Using valid SQLite, answer the following questions for the tables provid... | SELECT COUNT("team") FROM table_204_722 WHERE "position" = 3 | squall |
CREATE TABLE table_24205 (
"Game" real,
"Date" text,
"Opponent" text,
"Result" text,
"Cowboys points" real,
"Opponents" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the team record when the team played @ Utah?
| SELECT "Record" FROM table_24205 WHERE "Opponent" = '@ Utah' | wikisql |
CREATE TABLE table_3244 (
"Round" real,
"Circuit" text,
"Date" text,
"Pole Position" text,
"Fastest Lap" text,
"Winning Driver" text,
"Winning Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what circuit was Bruno Spengler the winnin... | SELECT "Circuit" FROM table_3244 WHERE "Winning Driver" = 'Bruno Spengler' | wikisql |
CREATE TABLE table_19922 (
"Series Ep." text,
"Episode" real,
"Segment A" text,
"Segment B" text,
"Segment C" text,
"Segment D" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the segment B of episode 242?
| SELECT "Segment B" FROM table_19922 WHERE "Episode" = '242' | wikisql |
CREATE TABLE table_28447 (
"Season" real,
"Series" text,
"Team" text,
"Races" real,
"Wins" real,
"Poles" real,
"F/Laps" real,
"Podiums" real,
"Points" text,
"Position" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the ma... | SELECT MAX("Wins") FROM table_28447 | wikisql |
CREATE TABLE vitalperiodic (
vitalperiodicid number,
patientunitstayid number,
temperature number,
sao2 number,
heartrate number,
respiration number,
systemicsystolic number,
systemicdiastolic number,
systemicmean number,
observationtime time
)
CREATE TABLE intakeoutput (
in... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-64091')) AND vitalperiodic.heartrate < 79.0 AND NOT vitalperiodi... | eicu |
CREATE TABLE table_1342256_11 (
first_elected INTEGER,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What year was Stephen Pace elected?
| SELECT MIN(first_elected) FROM table_1342256_11 WHERE incumbent = "Stephen Pace" | sql_create_context |
CREATE TABLE table_28922 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What incumbent was a federalist that was first elected in 1803?
| SELECT "Incumbent" FROM table_28922 WHERE "Party" = 'Federalist' AND "First elected" = '1803' | wikisql |
CREATE TABLE table_78680 (
"Year" real,
"Date" text,
"Home Team" text,
"Result" text,
"Visiting Team" text,
"Venue" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Venue of the 2009 St. Louis Rams Home game?
| SELECT "Venue" FROM table_78680 WHERE "Year" = '2009' AND "Home Team" = 'st. louis rams' | wikisql |
CREATE TABLE table_67981 (
"Competition" text,
"Venue" text,
"Year" real,
"Category" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What are the competitions that occurred before 2006 in SVK Nitra?
| SELECT "Competition" FROM table_67981 WHERE "Year" < '2006' AND "Venue" = 'svk nitra' | wikisql |
CREATE TABLE table_name_2 (
away_team VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the name of the away team that played at Kardinia Park?
| SELECT away_team FROM table_name_2 WHERE venue = "kardinia park" | sql_create_context |
CREATE TABLE customer_addresses (
customer_id number,
address_id number,
date_from time,
address_type text,
date_to time
)
CREATE TABLE addresses (
address_id number,
address_details text,
city text,
zip_postcode text,
state_province_county text,
country text
)
CREATE TABLE... | SELECT route_name FROM delivery_routes ORDER BY route_name | spider |
CREATE TABLE table_name_16 (
displacement VARCHAR,
torque VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the displacement having a torque of n m (lb ft) @ 3000 rpm?
| SELECT displacement FROM table_name_16 WHERE torque = "n·m (lb·ft) @ 3000 rpm" | 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 lab (
subject_id text,
hadm_id text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Ulcer of heel and midfoot" AND prescriptions.route = "TP" | mimicsql_data |
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 demographic ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2133.0" AND procedures.icd9_code = "3950" | mimicsql_data |
CREATE TABLE table_28677723_16 (
total INTEGER,
couple VARCHAR,
karianne_gulliksen VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the greatest total score received by aylar & egor when karianne Gulliksen gave an 8?
| SELECT MAX(total) FROM table_28677723_16 WHERE couple = "Aylar & Egor" AND karianne_gulliksen = 8 | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((date_day.day_number = 26 AND date_day.month_number = 7 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE company (
Company_ID int,
Rank int,
Company text,
Headquarters text,
Main_Industry text,
Sales_billion real,
Profits_billion real,
Assets_billion real,
Market_Value real
)
CREATE TABLE station_company (
Station_ID int,
Company_ID int,
Rank_of_the_Year int
)
... | SELECT Company, Market_Value FROM company WHERE Main_Industry = 'Banking' | nvbench |
CREATE TABLE table_203_843 (
id number,
"record" text,
"date and time" text,
"competition" text,
"home or away" text,
"opponent" text,
"score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- did st albans score more goals against ruislip mano... | SELECT "opponent" FROM table_203_843 WHERE "opponent" IN ('ruislip manor', 'tufnell spartans') ORDER BY "score" DESC LIMIT 1 | squall |
CREATE TABLE table_43019 (
"Country" text,
"Area (km\u00b2)" text,
"Population (2011 est.)" text,
"Population density (per km\u00b2)" text,
"GDP (PPP) $M USD" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much is the GDP for an area of 116?
| SELECT "GDP (PPP) $M USD" FROM table_43019 WHERE "Area (km\u00b2)" = '116' | wikisql |
CREATE TABLE table_55891 (
"Name" text,
"Entered office" text,
"Left office" text,
"Political party" text,
"Monarchs served" text,
"Birth Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What monarch(s) did Stanley Baldwin (1st ministry) se... | SELECT "Monarchs served" FROM table_55891 WHERE "Name" = 'stanley baldwin (1st ministry)' | wikisql |
CREATE TABLE table_59282 (
"7:30 am" text,
"8:00 am" text,
"9:00 am" text,
"11:00 am" text,
"noon" text,
"12:30 pm" text,
"1:00 pm" text,
"1:30 pm" text,
"2:00 pm" text,
"3:00 pm" text,
"3:30 pm" text,
"5:00 pm" text,
"6:30 pm" text
)
-- Using valid SQLite, answer t... | SELECT "3:30 pm" FROM table_59282 WHERE "2:00 pm" = 'another world' | wikisql |
CREATE TABLE table_69798 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country has the most bronze and has more than one silver, 1 gold, and less than 4 tota... | SELECT MAX("Bronze") FROM table_69798 WHERE "Silver" > '1' AND "Gold" = '1' AND "Total" < '4' | wikisql |
CREATE TABLE table_204_920 (
id number,
"goal" number,
"date" text,
"location" text,
"opponent" text,
"lineup" text,
"min" number,
"assist/pass" text,
"score" text,
"result" text,
"competition" text
)
-- Using valid SQLite, answer the following questions for the tables prov... | SELECT "opponent" FROM table_204_920 WHERE "goal" = 1 | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.