instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city v... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course, program, program_course WHERE 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_25256 (
"Conference" text,
"Regular Season Winner" text,
"Conference Player of the Year" text,
"Conference Tournament" text,
"Tournament Venue (City)" text,
"Tournament Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Tournament Winner" FROM table_25256 WHERE "Regular Season Winner" = 'Princeton' | wikisql |
CREATE TABLE table_552 (
"English Title/Translation" text,
"Japanese Title" text,
"Developer" text,
"Publisher" text,
"Genre" text,
"Console(s)" text,
"Initial Release Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the genre of ... | SELECT "Genre" FROM table_552 WHERE "English Title/Translation" = 'Fever Ranma ½: Hot Springs Athletic Chapter' | wikisql |
CREATE TABLE table_name_81 (
title VARCHAR,
director VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what title was Stephen Fossatti the director of?
| SELECT title FROM table_name_81 WHERE director = "stephen fossatti" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
... | SELECT 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 = 19175)) AND DATETIME(inputevents_cv.charttime, 'start of month') = DATETIME(CURRENT_TIME(), ... | mimic_iii |
CREATE TABLE table_203_102 (
id number,
"event" text,
"performance" text,
"athlete" text,
"nation" text,
"place" text,
"date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of world records that were recorded in august ?
| SELECT COUNT(*) FROM table_203_102 WHERE "date" = 8 | squall |
CREATE TABLE table_name_82 (
frequency VARCHAR,
destination VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the frequency of the train to Bangalore?
| SELECT frequency FROM table_name_82 WHERE destination = "bangalore" | sql_create_context |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT ZZYSGH, QTJZYSGH FROM mzjzjlb WHERE JZLSH = '09772478615' | css |
CREATE TABLE table_name_67 (
played INTEGER,
team VARCHAR,
place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the sum of played for c.d. luis ngel firpo and place more than 3
| SELECT SUM(played) FROM table_name_67 WHERE team = "c.d. luis ángel firpo" AND place > 3 | sql_create_context |
CREATE TABLE table_8397 (
"Name" text,
"Country of Origin" text,
"Position" text,
"Elected" real,
"Term" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest term from the 2007 election with the position of chairperson?
| SELECT MIN("Term") FROM table_8397 WHERE "Elected" = '2007' AND "Position" = 'chairperson' | wikisql |
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
... | SELECT * 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 = '58973613' AND hz_info.YLJGDM = '3560417' AND NOT mzjzjlb.JZZDSM LIKE '%低钾血症%' | css |
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) DESC | nvbench |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Crbl emblsm w infrct" AND prescriptions.drug_type = "MAIN" | mimicsql_data |
CREATE TABLE table_61152 (
"7:00 am" text,
"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,
"4:00 pm" text,
"4:30 pm" text,
"5:00 pm" ... | SELECT "8:00 am" FROM table_61152 WHERE "11:00 am" = 'local programs' | wikisql |
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
COM_PAY number,
DATA_ID text,
ENT_ACC_PAY number,
ENT_PAY number,
F... | SELECT COUNT(*) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '5136139' AND gwyjzb.IN_HOSP_DATE BETWEEN '2012-09-20' AND '2019-05-04' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT COUNT(*) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '5136139' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2012-09-20' AND '2019-05-04' AND fgwyjzb.CLINIC_TY... | css |
CREATE TABLE table_71784 (
"Date" text,
"Region" text,
"Label" text,
"Catalogue" text,
"Format" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which catalogue has essential, castle music as it's label?
| SELECT "Catalogue" FROM table_71784 WHERE "Label" = 'essential, castle music' | wikisql |
CREATE TABLE grapes (
id number,
grape text,
color text
)
CREATE TABLE wine (
no number,
grape text,
winery text,
appelation text,
state text,
name text,
year number,
price number,
score number,
cases number,
drink text
)
CREATE TABLE appellations (
no numbe... | SELECT name FROM wine WHERE price > (SELECT MAX(price) FROM wine WHERE year = 2006) | spider |
CREATE TABLE table_name_74 (
round INTEGER,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many players were drafted from the Boston Cannons in the round?
| SELECT SUM(round) FROM table_name_74 WHERE team = "boston cannons" | sql_create_context |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE pat... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture - neonate') | mimic_iii |
CREATE TABLE table_22486 (
"Township" text,
"County" text,
"Pop. (2010)" real,
"Land ( sqmi )" text,
"Water (sqmi)" text,
"Latitude" text,
"Longitude" text,
"GEO ID" real,
"ANSI code" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Wh... | SELECT "Water (sqmi)" FROM table_22486 WHERE "Latitude" = '48.423224' | wikisql |
CREATE TABLE table_55312 (
"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 Crowd has an Away team score of 17.11 (113... | SELECT SUM("Crowd") FROM table_55312 WHERE "Away team score" = '17.11 (113)' | 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 patient (
uniquep... | SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74752')) AND intakeoutput.cellpath LIKE '%in... | eicu |
CREATE TABLE table_3906 (
"No. in series" real,
"No. in season" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"U.S. viewers (million)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number in the s... | SELECT MAX("No. in season") FROM table_3906 WHERE "Title" = 'Burning Down the House' | wikisql |
CREATE TABLE table_11734041_3 (
school_club_team_country VARCHAR,
years_for_rockets VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which school, club team, or country played for the rockets in the years 2000-01?
| SELECT school_club_team_country FROM table_11734041_3 WHERE years_for_rockets = "2000-01" | sql_create_context |
CREATE TABLE table_27882867_9 (
location_attendance VARCHAR,
high_points VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location and attendance when d. wilkins (29) had the high points?
| SELECT location_attendance FROM table_27882867_9 WHERE high_points = "D. Wilkins (29)" | sql_create_context |
CREATE TABLE table_2359 (
"Round" real,
"Choice" real,
"Player" text,
"Position" text,
"Height" text,
"Weight" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many positions have round 3?
| SELECT COUNT("Position") FROM table_2359 WHERE "Round" = '3' | wikisql |
CREATE TABLE table_23495048_2 (
represent VARCHAR,
height__mtr_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which country had a contestant that was 1.76 meters tall?
| SELECT represent FROM table_23495048_2 WHERE height__mtr_ = "1.76" | sql_create_context |
CREATE TABLE STUDENT (
STU_NUM int,
STU_LNAME varchar(15),
STU_FNAME varchar(15),
STU_INIT varchar(1),
STU_DOB datetime,
STU_HRS int,
STU_CLASS varchar(2),
STU_GPA float(8),
STU_TRANSFER numeric,
DEPT_CODE varchar(18),
STU_PHONE varchar(4),
PROF_NUM int
)
CREATE TABLE PR... | SELECT DEPT_CODE, MAX(STU_GPA) FROM STUDENT GROUP BY DEPT_CODE | nvbench |
CREATE TABLE table_name_88 (
engine VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the engine for dhg tom's racing
| SELECT engine FROM table_name_88 WHERE team = "dhg tom's racing" | sql_create_context |
CREATE TABLE table_train_130 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"right_bundle_branch_block" bool,
"space_occupying_cerebral_lesion" bool,
"huntington_disease" bool,
"psychiatric_disease" bool,
"mental_illness" bool,
"treatment_regimen" bool,
"psychoti... | SELECT * FROM table_train_130 WHERE systolic_blood_pressure_sbp > 160 OR diastolic_blood_pressure_dbp > 100 OR hypertension = 1 OR treatment_regimen = 1 | criteria2sql |
CREATE TABLE publication (
abstract varchar,
cid int,
citation_num int,
jid int,
pid int,
reference_num int,
title varchar,
year int
)
CREATE TABLE domain_conference (
cid int,
did int
)
CREATE TABLE domain_journal (
did int,
jid int
)
CREATE TABLE writes (
aid int... | SELECT author.name FROM author, journal, publication, writes WHERE journal.name = 'PVLDB' AND publication.jid = journal.jid AND writes.aid = author.aid AND writes.pid = publication.pid GROUP BY author.name ORDER BY COUNT(DISTINCT (publication.title)) DESC LIMIT 1 | academic |
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 Headquarter, AVG(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC | nvbench |
CREATE TABLE table_51602 (
"Track" real,
"Title" text,
"Translation" text,
"Composer" text,
"Recorded" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of tracks for of the fallen angel
| SELECT COUNT("Track") FROM table_51602 WHERE "Translation" = 'the fallen angel' | wikisql |
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 TABLE artist (
artist_name text,
country text,
gender text,
preferred_genre text
)
CREATE TABL... | SELECT T1.artist_name, T1.country FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.rating DESC LIMIT 3 | spider |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE treatment (
treatmenti... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE NOT patient.hospitaldischargetime IS NULL | eicu |
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,
predicted_gradu... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department LIKE '%MEDADM%' AND program_course.category LIKE '%ULCS%' 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 Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adults INTEGER,
Kids INTEGER
)
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
baseP... | SELECT decor, COUNT(*) FROM Rooms WHERE bedType = "King" GROUP BY decor ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_51768 (
"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.
-- Who was Melbourne's away team opponent?
| SELECT "Away team" FROM table_51768 WHERE "Home team" = 'melbourne' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE diagnoses.short_title = "Full incontinence-feces" AND procedures.short_title = "Int insert dual-cham dev" | mimicsql_data |
CREATE TABLE table_name_65 (
weight VARCHAR,
series VARCHAR,
reverse VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much did the Modern Pentathlon III Series coin weigh?
| SELECT weight FROM table_name_65 WHERE series = "iii series" AND reverse = "modern pentathlon" | 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "M" | mimicsql_data |
CREATE TABLE table_18327 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Result" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district did the Democratic party incumbent Stephen J. Solarz get f... | SELECT "District" FROM table_18327 WHERE "Party" = 'Democratic' AND "First elected" = '1974' AND "Incumbent" = 'Stephen J. Solarz' | wikisql |
CREATE TABLE table_name_85 (
altitude__mslm_ INTEGER,
density__inhabitants_km_2__ VARCHAR,
rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Altitude (mslm) has a Density (inhabitants/km 2) smaller than 1233, and a Rank of 9th?
| SELECT SUM(altitude__mslm_) FROM table_name_85 WHERE density__inhabitants_km_2__ < 1233 AND rank = "9th" | sql_create_context |
CREATE TABLE table_name_87 (
engine VARCHAR,
year INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What engine was used after 1984?
| SELECT engine FROM table_name_87 WHERE year > 1984 | sql_create_context |
CREATE TABLE weekly_weather (
station_id int,
day_of_week text,
high_temperature int,
low_temperature int,
precipitation real,
wind_speed_mph int
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TABLE station (
id int,
network_name text,
services text,
local... | SELECT local_authority, COUNT(local_authority) FROM station GROUP BY services, local_authority ORDER BY local_authority | nvbench |
CREATE TABLE table_54023 (
"Rank" real,
"Name" text,
"City" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the total of floors when the name is k lntriangle and rank is less thank 63?... | SELECT SUM("Floors") FROM table_54023 WHERE "Name" = 'kölntriangle' AND "Rank" < '63' | wikisql |
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 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 = "Stevens-Johnson-TEN syn" AND prescriptions.route = "ID" | mimicsql_data |
CREATE TABLE table_46129 (
"First Vice President" text,
"Second Vice President" text,
"Third Vice president" text,
"Inaugurated" text,
"Left Office" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Second Vice President, when Inaugurated is '2... | SELECT "Second Vice President" FROM table_46129 WHERE "Inaugurated" = '26 march 1928' | wikisql |
CREATE TABLE table_name_66 (
cost___us$__ VARCHAR,
open_source VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the cost of an Open Source that is no?
| SELECT cost___us$__ FROM table_name_66 WHERE open_source = "no" | sql_create_context |
CREATE TABLE table_33212 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" text,
"Best" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was Dan Selznick best time?
| SELECT "Best" FROM table_33212 WHERE "Name" = 'dan selznick' | wikisql |
CREATE TABLE table_77798 (
"Player" text,
"Club" text,
"League" real,
"Play-offs" real,
"FA Cup" real,
"FA Trophy" real,
"Total" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which of the lowest leagues had Aldershot town as a club when the... | SELECT MIN("League") FROM table_77798 WHERE "Club" = 'aldershot town' AND "Play-offs" < '0' | wikisql |
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
Ta... | SELECT q.Id AS "Id", 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(15)) AS "Link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<' + @Tag1 + '>%' AND q.Tags LIKE '%<' + @Tag2 + '>%' AND q.Tags LIKE '%<' + @Tag3 + '>%' ORDER BY q.Id | sede |
CREATE TABLE table_23248967_10 (
high_points VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who scored the high points in game 78?
| SELECT high_points FROM table_23248967_10 WHERE game = 78 | sql_create_context |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT Users.DisplayName, COUNT(*) AS questions FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Users ON Users.Id = Posts.OwnerUserId WHERE Tags.Id = 34113 AND Posts.CreationDate > '2015-01-01 00:00:00' GROUP BY Users.DisplayName ORDER BY questio... | sede |
CREATE TABLE table_54978 (
"Date" text,
"Visitor" text,
"Score" text,
"Home" text,
"Leading scorer" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In the game on 11 March 2008 with a visiting team of Bucks, who was the home team?
| SELECT "Home" FROM table_54978 WHERE "Visitor" = 'bucks' AND "Date" = '11 march 2008' | wikisql |
CREATE TABLE race (
Race_ID int,
Name text,
Class text,
Date text,
Track_ID text
)
CREATE TABLE track (
Track_ID int,
Name text,
Location text,
Seating real,
Year_Opened real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give me a b... | SELECT Class, COUNT(*) FROM race GROUP BY Class ORDER BY Class | nvbench |
CREATE TABLE table_56857 (
"Name" text,
"City" text,
"Height (m)" real,
"Height (ft)" real,
"Floors" real,
"Years as tallest" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For a height less than 122 meters, what is the greatest height in feet?
| SELECT MAX("Height (ft)") FROM table_56857 WHERE "Height (m)" < '122' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE chartevents ... | SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 72909 AND admissions.dischtime IS NULL) | mimic_iii |
CREATE TABLE table_name_8 (
operator VARCHAR,
ship VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What operator has a ship costa pacifica?
| SELECT operator FROM table_name_8 WHERE ship = "costa pacifica" | sql_create_context |
CREATE TABLE table_59906 (
"Season" text,
"Date Released" text,
"# Of Episodes" real,
"# Of Discs" real,
"Special Features" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Date Released, when # Of Discs is greater than 4?
| SELECT "Date Released" FROM table_59906 WHERE "# Of Discs" > '4' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND procedures.long_title = "Combined right and left heart cardiac catheterization" | mimicsql_data |
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_Percent, All_Games_Percent FROM basketball_match GROUP BY ACC_Road | nvbench |
CREATE TABLE Documents (
document_id VARCHAR,
document_name VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the ids and names of all documents.
| SELECT document_id, document_name FROM Documents | sql_create_context |
CREATE TABLE table_name_12 (
country VARCHAR,
debt_as__percentage_of_value VARCHAR,
_percentage_change_on_year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the country where % change on year is 21 and value is less than 86
| SELECT country FROM table_name_12 WHERE debt_as__percentage_of_value < 86 AND _percentage_change_on_year = "21" | sql_create_context |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "URGENT" AND lab.label = "Amylase, Ascites" | mimicsql_data |
CREATE TABLE table_name_95 (
date VARCHAR,
record VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the date of the game where the indians record was 37-44?
| SELECT date FROM table_name_95 WHERE record = "37-44" | sql_create_context |
CREATE TABLE table_name_98 (
college VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What college did pick 33 attend?
| SELECT college FROM table_name_98 WHERE pick = 33 | sql_create_context |
CREATE TABLE d_icd_procedures (
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 prescriptions (
... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.wardid = 49 AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | mimic_iii |
CREATE TABLE people (
country VARCHAR,
age INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the country where people older than 30 and younger than 25 are from.
| SELECT country FROM people WHERE age < 25 INTERSECT SELECT country FROM people WHERE age > 30 | 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 OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '3002384' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE table_5257 (
"Episode" real,
"Title" text,
"Airdate (Canada)" text,
"Airdate (USA)" text,
"CBS airdate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total number of episodes aired in Canada on 22 October 2004?
| SELECT COUNT("Episode") FROM table_5257 WHERE "Airdate (Canada)" = '22 october 2004' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT COUNT(*) FROM mzjzjlb WHERE YLJGDM = '4998470' AND JZKSRQ BETWEEN '2010-09-19' AND '2020-11-18' AND WDBZ > 0 | css |
CREATE TABLE table_22834834_12 (
year VARCHAR,
earnings__$_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years had a total earnings amount of 2254598?
| SELECT COUNT(year) FROM table_22834834_12 WHERE earnings__$_ = 2254598 | sql_create_context |
CREATE TABLE table_30120555_1 (
barony VARCHAR,
area__acres__ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which barony contains a townland with an area 24 acres?
| SELECT barony FROM table_30120555_1 WHERE area__acres__ = 24 | sql_create_context |
CREATE TABLE table_43709 (
"Call sign" text,
"Frequency MHz" real,
"City of license" text,
"ERP W" real,
"FCC info" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is average frequency MHZ when is in portales, new mexico?
| SELECT AVG("Frequency MHz") FROM table_43709 WHERE "City of license" = 'portales, new mexico' | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.long_title = "Malignant neoplasm of other sites of tongue" AND lab.flag = "abnormal" | mimicsql_data |
CREATE TABLE table_70744 (
"Year" real,
"Entrant" text,
"Chassis" text,
"Engine" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many years did John Player Lotus used Cosworth v8?
| SELECT SUM("Year") FROM table_70744 WHERE "Engine" = 'cosworth v8' AND "Entrant" = 'john player lotus' | wikisql |
CREATE TABLE zyjzjlb (
YLJGDM text,
JZLSH text,
MZJZLSH text,
KH text,
KLX number,
HZXM text,
WDBZ number,
RYDJSJ time,
RYTJDM number,
RYTJMC text,
JZKSDM text,
JZKSMC text,
RZBQDM text,
RZBQMC text,
RYCWH text,
CYKSDM text,
CYKSMC text,
CYBQDM tex... | SELECT * FROM jyjgzbb WHERE JCZBMC = (SELECT JCZBMC FROM jyjgzbb WHERE JYZBLSH = '37036653223') AND JCZBJGDW = (SELECT JCZBJGDW FROM jyjgzbb WHERE JYZBLSH = '37036653223') AND JCZBJGDL = (SELECT JCZBJGDL FROM jyjgzbb WHERE JYZBLSH = '37036653223') | css |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid number,
chargetime time,
cost number... | SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-95970')) AND vitalperiodic.respiration < 32.0 A... | eicu |
CREATE TABLE table_16795394_3 (
team__number1 VARCHAR,
team__number2 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If team two is San Lorenzo, how many were on team one?
| SELECT COUNT(team__number1) FROM table_16795394_3 WHERE team__number2 = "San Lorenzo" | sql_create_context |
CREATE TABLE table_name_50 (
hdtv VARCHAR,
content VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the HDTV when the content is general television?
| SELECT hdtv FROM table_name_50 WHERE content = "general television" | sql_create_context |
CREATE TABLE table_203_8 (
id number,
"player" text,
"rec." number,
"yards" number,
"avg." number,
"td's" number,
"long" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which player 's average is higher than ira gooch 's ?
| SELECT "player" FROM table_203_8 WHERE "avg." > (SELECT "avg." FROM table_203_8 WHERE "player" = 'ira gooch') | squall |
CREATE TABLE table_5115 (
"Year" real,
"Class" text,
"Team" text,
"Points" real,
"Rank" text,
"Wins" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the last year that they had less than 16 points in class 500cc?
| SELECT MAX("Year") FROM table_5115 WHERE "Points" < '16' AND "Class" = '500cc' | 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 employees (
EMPLOYEE_ID decimal(6,0... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE On_Call (
Nurse INTEGER,
BlockFloor INTEGER,
BlockCode INTEGER,
OnCallStart DATETIME,
OnCallEnd DATETIME
)
CREATE TABLE Physician (
EmployeeID INTEGER,
Name VARCHAR(30),
Position VARCHAR(30),
SSN INTEGER
)
CREATE TABLE Appointment (
AppointmentID INTEGER,
Patie... | SELECT Name, COUNT(*) FROM Medication AS T1 JOIN Prescribes AS T2 ON T1.Code = T2.Medication GROUP BY T1.Brand | nvbench |
CREATE TABLE person_info (
RYBH text,
XBDM number,
XBMC text,
XM text,
CSRQ time,
CSD text,
MZDM text,
MZMC text,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
XLDM text,
XLMC text,
ZYLBDM text,
ZYMC text
)
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH ... | SELECT SHRGH, SHRXM FROM jyjgzbb WHERE JYZBLSH = '08740344505' | css |
CREATE TABLE table_18481791_3 (
title VARCHAR,
no_in_series VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the title of series 23?
| SELECT title FROM table_18481791_3 WHERE no_in_series = 23 | sql_create_context |
CREATE TABLE table_49327 (
"Res." text,
"Record" text,
"Opponent" text,
"Method" text,
"Event" text,
"Round" real,
"Time" text,
"Location" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Can you tell me the Time that has the Opponent of p... | SELECT "Time" FROM table_49327 WHERE "Opponent" = 'phil baroni' | wikisql |
CREATE TABLE Financial_Transactions (
transaction_id INTEGER,
account_id INTEGER,
invoice_number INTEGER,
transaction_type VARCHAR(15),
transaction_date DATETIME,
transaction_amount DECIMAL(19,4),
transaction_comment VARCHAR(255),
other_transaction_details VARCHAR(255)
)
CREATE TABLE Pr... | SELECT account_id, account_name FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.customer_first_name = 'Meaghan' | nvbench |
CREATE TABLE table_44048 (
"Class" text,
"Wheel arrangement" text,
"Manufacturer" text,
"Year made" text,
"Quantity made" text,
"Quantity preserved" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Quantity Made, when Manufacturer is 'Bald... | SELECT "Quantity made" FROM table_44048 WHERE "Manufacturer" = 'baldwin' | wikisql |
CREATE TABLE table_74064 (
"Total #" real,
"Episode #" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many different episode numbers does the episode written by S... | SELECT COUNT("Total #") FROM table_74064 WHERE "Written by" = 'Sheri Elwood' AND "Directed by" = 'Jim Allodi' | wikisql |
CREATE TABLE table_name_96 (
name VARCHAR,
decile VARCHAR,
area VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which name has a Decile of 5, and an Area of tauranga?
| SELECT name FROM table_name_96 WHERE decile = 5 AND area = "tauranga" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb_jybgb (
YLJGDM_MZJZJLB text,
BGDH number,
YLJGDM number
)
CREATE TABLE jyjgzbb (
BGDH text,
BGRQ time,
CKZFWDX text,
CKZFWSX number,
CKZFWXX number,
JCFF text,
JCRGH text,
... | SELECT jybgb.BGDH FROM jybgb WHERE jybgb.JZLSH = '25783022508' AND jybgb.KSMC LIKE '%内镜%' | 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 diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.gender = "M" AND demographic.dod_year < "2168.0" | mimicsql_data |
CREATE TABLE table_204_107 (
id number,
"rank" number,
"nation" text,
"gold" number,
"silver" number,
"bronze" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the total number of gold medals italy earned ?
| SELECT "gold" FROM table_204_107 WHERE "nation" = 'italy' | squall |
CREATE TABLE table_name_13 (
copaxone VARCHAR,
mitoxantrone VARCHAR,
betaseron__beta_1b_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the copaxone with mitoxantrone of no and betaseron (beta-1b) of no
| SELECT copaxone FROM table_name_13 WHERE mitoxantrone = "no" AND betaseron__beta_1b_ = "no" | 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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "86" AND prescriptions.formulary_drug_cd = "LEVOBASE2" | 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 WHERE demographic.diagnosis = "RUQ PAIN" AND demographic.admityear < "2131" | mimicsql_data |
CREATE TABLE table_75475 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many games have a record of 30 25 9 and more points than 69?
| SELECT COUNT("Game") FROM table_75475 WHERE "Record" = '30–25–9' AND "Points" > '69' | wikisql |
CREATE TABLE table_name_37 (
name VARCHAR,
games VARCHAR,
medal VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Name had a Games of 2008 beijing, and a Medal of gold?
| SELECT name FROM table_name_37 WHERE games = "2008 beijing" AND medal = "gold" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.