instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
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 prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Heparin (IABP)" | mimicsql_data |
CREATE TABLE table_32354 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the score of the team that plays in lake... | SELECT "Away team score" FROM table_32354 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE Documents_to_be_Destroyed (
Document_ID INTEGER,
Destruction_Authorised_by_Employee_ID INTEGER,
Destroyed_by_Employee_ID INTEGER,
Planned_Destruction_Date DATETIME,
Actual_Destruction_Date DATETIME,
Other_Details VARCHAR(255)
)
CREATE TABLE Ref_Calendar (
Calendar_Date DATETIME... | SELECT Calendar_Date, COUNT(Calendar_Date) FROM Ref_Calendar ORDER BY COUNT(Calendar_Date) | nvbench |
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE Tags (
Id number,
TagName text,
C... | SELECT LENGTH(Title) AS "length", Title, Id AS "post_link" FROM Posts WHERE PostTypeId = 1 ORDER BY LENGTH(Title) | sede |
CREATE TABLE table_name_29 (
team_2 VARCHAR,
team_1 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- who is the team 2 when the team 1 is sestese(e16)?
| SELECT team_2 FROM table_name_29 WHERE team_1 = "sestese(e16)" | sql_create_context |
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.icd9_code = "25061" AND prescriptions.route = "IVPCA" | mimicsql_data |
CREATE TABLE table_name_4 (
game INTEGER,
october VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average game number that was on october 19?
| SELECT AVG(game) FROM table_name_4 WHERE october = 19 | sql_create_context |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE PostTypes (
Id number,
Name text
)
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
... | SELECT p.Id AS "post_link", v.CreationDate FROM Votes AS v INNER JOIN Posts AS p ON v.PostId = p.Id AND p.OwnerUserId = '##UserId##' WHERE v.VoteTypeId = 15 | sede |
CREATE TABLE table_55762 (
"Driver" text,
"Constructor" text,
"Laps" real,
"Time/Retired" text,
"Grid" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the time/retired when the grid is 9?
| SELECT "Time/Retired" FROM table_55762 WHERE "Grid" = '9' | wikisql |
CREATE TABLE table_name_49 (
ihsaa_class VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which IHSAA Class has a Location of columbia city?
| SELECT ihsaa_class FROM table_name_49 WHERE location = "columbia city" | 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 demographic (
subject_id text,
hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "43" AND lab.label = "Epithelial Cells" | mimicsql_data |
CREATE TABLE mzjzjlb (
YLJGDM text,
JZLSH text,
KH text,
KLX number,
MJZH text,
HZXM text,
NLS number,
NLY number,
ZSEBZ number,
JZZTDM number,
JZZTMC text,
JZJSSJ time,
TXBZ number,
ZZBZ number,
WDBZ number,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT MZZYZDZZBM FROM zyjzjlb WHERE JZLSH = '22762045493' | css |
CREATE TABLE table_49170 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place has a to par of E?
| SELECT "Place" FROM table_49170 WHERE "To par" = 'e' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_days text
)
CREATE TABLE flight_s... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'CHARLOTTE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BAL... | atis |
CREATE TABLE table_7517 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the total attendance October 22, 1972?
| SELECT SUM("Attendance") FROM table_7517 WHERE "Date" = 'october 22, 1972' | 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 t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.t_kc21_PERSON_ID = '59839403' AND t_kc22.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 2930.76) | css |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | SELECT roomName, COUNT(roomName) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId WHERE FirstName LIKE '%ROY%' GROUP BY roomName | nvbench |
CREATE TABLE TRANSACTIONS (
investor_id VARCHAR,
share_count INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Show the average share count of transactions each each investor, ordered by average share count.
| SELECT investor_id, AVG(share_count) FROM TRANSACTIONS GROUP BY investor_id ORDER BY AVG(share_count) | sql_create_context |
CREATE TABLE table_name_16 (
score VARCHAR,
decision VARCHAR,
home VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the score of the home Dallas game that had a decision of Legace?
| SELECT score FROM table_name_16 WHERE decision = "legace" AND home = "dallas" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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 t... | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jy... | css |
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_JOBCODE varchar(5),
EMP_HIREDATE datetime,
EMP_DOB datetime
)
CREATE TABLE PROFESSOR (
EMP_NUM int,
DEPT_CODE varchar(10),
PROF_OFFICE varchar(50),
PROF_EXTENSION v... | SELECT DEPT_CODE, SUM(STU_HRS) FROM STUDENT GROUP BY DEPT_CODE ORDER BY DEPT_CODE | nvbench |
CREATE TABLE table_63294 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Channel" text,
"Stadium" text,
"Attendance" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has an Attendance of 63,447?
| SELECT "Week" FROM table_63294 WHERE "Attendance" = '63,447' | wikisql |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY AVG(MANAGER_ID) DESC | nvbench |
CREATE TABLE Apartments (
apt_id INTEGER,
building_id INTEGER,
apt_type_code CHAR(15),
apt_number CHAR(10),
bathroom_count INTEGER,
bedroom_count INTEGER,
room_count CHAR(5)
)
CREATE TABLE Apartment_Bookings (
apt_booking_id INTEGER,
apt_id INTEGER,
guest_id INTEGER,
booking... | SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 2 | nvbench |
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 All_Neutral, All_Games_Percent FROM basketball_match | nvbench |
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardid number,
intime time,
outtime time
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE admis... | SELECT microbiologyevents.spec_type_desc FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 10686) AND STRFTIME('%y-%m', microbiologyevents.charttime) <= '2105-08' ORDER BY microbiologyevents.charttime LIMIT 1 | mimic_iii |
CREATE TABLE browser (
id int,
name text,
market_share real
)
CREATE TABLE accelerator_compatible_browser (
accelerator_id int,
browser_id int,
compatible_since_year int
)
CREATE TABLE Web_client_accelerator (
id int,
name text,
Operating_system text,
Client text,
Connectio... | SELECT name, id FROM Web_client_accelerator AS T1 JOIN accelerator_compatible_browser AS T2 ON T2.accelerator_id = T1.id ORDER BY id DESC | nvbench |
CREATE TABLE table_name_31 (
year INTEGER,
chassis VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- waht is the last year with a mclaren mp4/10b chassis
| SELECT MAX(year) FROM table_name_31 WHERE chassis = "mclaren mp4/10b" | sql_create_context |
CREATE TABLE management (
department_ID int,
head_ID int,
temporary_acting text
)
CREATE TABLE department (
Department_ID int,
Name text,
Creation text,
Ranking int,
Budget_in_Billions real,
Num_Employees real
)
CREATE TABLE head (
head_ID int,
name text,
born_state tex... | SELECT Creation, AVG(Budget_in_Billions) FROM department GROUP BY Creation ORDER BY Creation | nvbench |
CREATE TABLE table_61536 (
"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 earliest year the world junior championships has 1500 m notes?
| SELECT MIN("Year") FROM table_61536 WHERE "Notes" = '1500 m' AND "Competition" = 'world junior championships' | wikisql |
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required text,
minimum_stay int,
maximum_stay int,
application text,
no_discounts text
)
CREATE ... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE... | atis |
CREATE TABLE procedures (
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 lab.fluid FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.name = "Stephanie Suchan" | mimicsql_data |
CREATE TABLE table_52847 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the average number in attendance on September 16?
| SELECT AVG("Attendance") FROM table_52847 WHERE "Date" = 'september 16' | wikisql |
CREATE TABLE circuits (
circuitId INTEGER,
circuitRef TEXT,
name TEXT,
location TEXT,
country TEXT,
lat REAL,
lng REAL,
alt TEXT,
url TEXT
)
CREATE TABLE qualifying (
qualifyId INTEGER,
raceId INTEGER,
driverId INTEGER,
constructorId INTEGER,
number INTEGER,
... | SELECT name, COUNT(name) FROM races WHERE year BETWEEN 2009 AND 2011 GROUP BY name | nvbench |
CREATE TABLE table_20867295_2 (
season VARCHAR,
winner VARCHAR,
third_place VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When twente came in third place and ajax was the winner what are the seasons?
| SELECT season FROM table_20867295_2 WHERE winner = "Ajax" AND third_place = "Twente" | sql_create_context |
CREATE TABLE date_day (
month_number int,
day_number int,
year int,
day_name varchar
)
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE restriction (
restriction_code text,
advance_purchase int,
stopovers text,
saturday_stay_required t... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 3 AND date_day.month_number = 9 AND dat... | atis |
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 = "HOME HEALTH CARE" AND procedures.short_title = "Tonsil&adenoid biopsy" | mimicsql_data |
CREATE TABLE table_name_36 (
bike VARCHAR,
grid VARCHAR,
time VARCHAR,
laps VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What bike has an accident time, less than 9 laps, and a 5 grid?
| SELECT bike FROM table_name_36 WHERE time = "accident" AND laps < 9 AND grid = 5 | sql_create_context |
CREATE TABLE diagnosis (
diagnosisid number,
patientunitstayid number,
diagnosisname text,
diagnosistime time,
icd9code text
)
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE vitalperiodic (
... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'diabetes mellitus' AND DATETIME(diagnosis.diagnosistime) <= DATETIME(CURRENT_TIME(), '-1 year')) AS t1 JOIN ... | eicu |
CREATE TABLE table_41868 (
"Peel" text,
"Wins" real,
"Byes" real,
"Losses" real,
"Draws" real,
"Against" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Losses has an Against of 1101, and a Byes smaller than 0?
| SELECT COUNT("Losses") FROM table_41868 WHERE "Against" = '1101' AND "Byes" < '0' | wikisql |
CREATE TABLE table_203_27 (
id number,
"number" number,
"serial no" number,
"entered service" text,
"withdrawn" text,
"kilometres travelled" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what serial numbers traveled more than 440,000 kilomete... | SELECT "serial no" FROM table_203_27 WHERE "kilometres travelled" > 440000 | squall |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT Founder, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder DESC | nvbench |
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_name_71 (
loss VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Loss has a Date of july 2?
| SELECT loss FROM table_name_71 WHERE date = "july 2" | sql_create_context |
CREATE TABLE table_7031 (
"Rank" real,
"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 rank when silver is 1, and gold is less than 7, and bronze is 2?
| SELECT SUM("Rank") FROM table_7031 WHERE "Silver" = '1' AND "Gold" < '7' AND "Bronze" = '2' | wikisql |
CREATE TABLE table_name_49 (
ihsaa_class VARCHAR,
school VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the IHSAA class for Chesterton?
| SELECT ihsaa_class FROM table_name_49 WHERE school = "chesterton" | sql_create_context |
CREATE TABLE Companies (
Industry VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please show the industries of companies in descending order of the number of companies.
| SELECT Industry FROM Companies GROUP BY Industry ORDER BY COUNT(*) DESC | sql_create_context |
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_... | SELECT COUNT(*) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 54390) AND STRFTIME('%y', prescriptions.startdate) <= '2102' | mimic_iii |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | SELECT Nationality, SUM(ID) FROM swimmer GROUP BY Nationality ORDER BY Nationality DESC | nvbench |
CREATE TABLE table_32727 (
"Rank" real,
"Rider" text,
"Team" text,
"Speed" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Rider finished with a speed of 80.18mph?
| SELECT "Rider" FROM table_32727 WHERE "Speed" = '80.18mph' | wikisql |
CREATE TABLE table_46923 (
"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.
-- What i... | SELECT "Date" FROM table_46923 WHERE "Game" = '17' | 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 allergy (
allergy... | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'urinary osmolality') | eicu |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE course_offering (
offering_id int,
course_id int,
... | SELECT DISTINCT instructor.name FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester INNER JOIN program_course ON program_course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instr... | advising |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.long_title = "Initial insertion of dual-chamber device" | mimicsql_data |
CREATE TABLE table_1342331_6 (
result VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the result in the election in which Ralph R. Eltse was the incumbent?
| SELECT result FROM table_1342331_6 WHERE incumbent = "Ralph R. Eltse" | sql_create_context |
CREATE TABLE music_festival (
Category VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please show the categories of the music festivals with count more than 1.
| SELECT Category FROM music_festival GROUP BY Category HAVING COUNT(*) > 1 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Kenneth Koeller" | mimicsql_data |
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 allergy (
allergy... | SELECT DISTINCT t1.c1 FROM (SELECT lab.labresult, PERCENT_RANK() OVER (ORDER BY lab.labresult) AS c1 FROM lab WHERE lab.labname = 'pao2' AND lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age = (SELECT patient.age FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospit... | eicu |
CREATE TABLE table_name_63 (
vacated_throne VARCHAR,
archbishop VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When did Archbishop Albert Daeger vacate the throne?
| SELECT vacated_throne FROM table_name_63 WHERE archbishop = "albert daeger" | sql_create_context |
CREATE TABLE weather (
date text,
max_temperature_f number,
mean_temperature_f number,
min_temperature_f number,
max_dew_point_f number,
mean_dew_point_f number,
min_dew_point_f number,
max_humidity number,
mean_humidity number,
min_humidity number,
max_sea_level_pressure_inc... | SELECT DISTINCT T1.id, T1.name FROM station AS T1 JOIN status AS T2 ON T1.id = T2.station_id WHERE T2.bikes_available > 12 | spider |
CREATE TABLE table_name_78 (
award VARCHAR,
year VARCHAR,
representative_work VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the award for 1998 with Representative Work of city beat?
| SELECT award FROM table_name_78 WHERE year = 1998 AND representative_work = "city beat" | sql_create_context |
CREATE TABLE table_71733 (
"Year" real,
"Date" text,
"Title" text,
"Format(s)" text,
"Award Description(s)" text,
"Result(s)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Give me the result for a format saying album with 1994 as the year.
| SELECT "Result(s)" FROM table_71733 WHERE "Format(s)" = 'album' AND "Year" = '1994' | wikisql |
CREATE TABLE table_7385 (
"Date" text,
"Opponent" text,
"Venue" text,
"Result" text,
"Attendance" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the lowest Attendance on 8 October 1986?
| SELECT MIN("Attendance") FROM table_7385 WHERE "Date" = '8 october 1986' | wikisql |
CREATE TABLE table_name_19 (
away_team VARCHAR,
ground VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Away Team, when Ground is Colonial Stadium?
| SELECT away_team FROM table_name_19 WHERE ground = "colonial stadium" | sql_create_context |
CREATE TABLE Ref_Incident_Type (
incident_type_code VARCHAR(10),
incident_type_description VARCHAR(80)
)
CREATE TABLE Addresses (
address_id INTEGER,
line_1 VARCHAR(120),
line_2 VARCHAR(120),
line_3 VARCHAR(120),
city VARCHAR(80),
zip_postcode VARCHAR(20),
state_province_county VARC... | SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes) DESC | nvbench |
CREATE TABLE table_name_77 (
constructor VARCHAR,
entrant VARCHAR,
driver VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the constructor of the officine alfieri maserati that was driven by Sergio Mantovani?
| SELECT constructor FROM table_name_77 WHERE entrant = "officine alfieri maserati" AND driver = "sergio mantovani" | sql_create_context |
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airlin... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILAD... | atis |
CREATE TABLE t_kc21_t_kc22 (
MED_CLINIC_ID text,
MED_EXP_DET_ID number
)
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,
C... | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '金天和' AND t_kc22.STA_DATE BETWEEN '2004-06-28' AND '2015-02-16' AND t_kc22.SELF_PAY_PRO < 0.79 | css |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "ATRO1I" | mimicsql_data |
CREATE TABLE table_71797 (
"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 sum of Richie Hebner winning games that were smaller 34?
| SELECT SUM("Games") FROM table_71797 WHERE "Manager" = 'richie hebner' AND "Wins" < '34' | wikisql |
CREATE TABLE table_204_985 (
id number,
"season" text,
"competition" text,
"round" text,
"club" text,
"home" text,
"away" text,
"aggregate" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many more home victories did this team have in... | SELECT (SELECT "home" FROM table_204_985 WHERE "season" = '2004/05') - (SELECT "home" FROM table_204_985 WHERE "season" = 2003) | squall |
CREATE TABLE table_23160 (
"Year" text,
"Number of Candidates" real,
"Total votes" real,
"Average voters per candidate" real,
"Percentage of vote" text,
"Saved deposits" real,
"Change (percentage points)" text,
"Number of MPs" real
)
-- Using valid SQLite, answer the following question... | SELECT MIN("Total votes") FROM table_23160 WHERE "Year" = '2005' | wikisql |
CREATE TABLE table_name_5 (
heat VARCHAR,
country VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What's the total number of Heat recorded for the british virgin islands?
| SELECT COUNT(heat) FROM table_name_5 WHERE country = "british virgin islands" | sql_create_context |
CREATE TABLE table_28334498_3 (
no_in_season INTEGER,
directed_by VARCHAR,
us_viewers__millions_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many episodes were directed by Jeff Melman and 1.21million viewers?
| SELECT MIN(no_in_season) FROM table_28334498_3 WHERE directed_by = "Jeff Melman" AND us_viewers__millions_ = "1.21" | sql_create_context |
CREATE TABLE table_62939 (
"Opposing Team" text,
"Against" real,
"Date" text,
"Venue" text,
"Round" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the total against on 08/12/1992?
| SELECT SUM("Against") FROM table_62939 WHERE "Date" = '08/12/1992' | wikisql |
CREATE TABLE table_20016339_1 (
fastest_laps VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many fastest laps did I.C. Team have?
| SELECT COUNT(fastest_laps) FROM table_20016339_1 WHERE team = "I.C. team" | sql_create_context |
CREATE TABLE management (
department_id number,
head_id number,
temporary_acting text
)
CREATE TABLE department (
department_id number,
name text,
creation text,
ranking number,
budget_in_billions number,
num_employees number
)
CREATE TABLE head (
head_id number,
name text,... | SELECT DISTINCT T1.creation FROM department AS T1 JOIN management AS T2 ON T1.department_id = T2.department_id JOIN head AS T3 ON T2.head_id = T3.head_id WHERE T3.born_state = 'Alabama' | spider |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | SELECT jybgb.BBCJBW FROM jybgb WHERE jybgb.BGDH = '33508848033' | css |
CREATE TABLE table_25711913_2 (
touchdowns INTEGER,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the minimum touchdowns of the Fullback player?
| SELECT MIN(touchdowns) FROM table_25711913_2 WHERE position = "Fullback" | sql_create_context |
CREATE TABLE table_76018 (
"Driver" text,
"Team" text,
"Laps" real,
"Time/Retired" text,
"Grid" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who scored with a grid of 10 and the highest amount of laps?
| SELECT MAX("Laps") FROM table_76018 WHERE "Grid" = '10' | wikisql |
CREATE TABLE table_name_23 (
position VARCHAR,
goals VARCHAR,
level VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Position of the winner with 18 Goals and Level of 5?
| SELECT position FROM table_name_23 WHERE goals = 18 AND level = 5 | sql_create_context |
CREATE TABLE table_27539272_7 (
location_attendance VARCHAR,
game VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the location and attendance for game 41?
| SELECT location_attendance FROM table_27539272_7 WHERE game = 41 | sql_create_context |
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
building_full_name VARCHAR(80),
building_description VARCHAR(255),
building_address VARCHAR(255),
building_manager VARCHAR(50),
building_phone VARCHAR(80)
)
CREATE TABLE Apartments (
apt_id INTEGER,
... | SELECT facility_code, COUNT(facility_code) FROM Apartment_Facilities AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.bedroom_count > 4 GROUP BY facility_code ORDER BY COUNT(facility_code) | nvbench |
CREATE TABLE table_24442 (
"Day" text,
"Stage" text,
"Time (CET)" text,
"Name" text,
"Length" text,
"Winner" text,
"Time" text,
"Avg. spd." text,
"Rally leader" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which days have a stage o... | SELECT "Day" FROM table_24442 WHERE "Stage" = 'SS11' | wikisql |
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwnerGuidance text,
MarkdownPrivilegedUserGuidance text,
MarkdownConcensusDescription text,
CreationDate time,
CreationModeratorId number,
ApprovalDa... | SELECT p.Id, p.Title, p.Body FROM Posts AS p JOIN PostTags AS pt ON p.Id = pt.PostId JOIN Tags AS t ON pt.TagId = t.Id JOIN Posts AS a ON p.AcceptedAnswerId = a.Id WHERE (t.TagName = '##TagName:string##') AND (NOT p.AcceptedAnswerId IS NULL) AND (p.CreationDate >= '##Date1?2016-01-01##') AND (p.CreationDate <= '##Date2... | sede |
CREATE TABLE table_name_59 (
attendance INTEGER,
home VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the Attendance when the Home team was Montreal, on the Date of March 24?
| SELECT SUM(attendance) FROM table_name_59 WHERE home = "montreal" AND date = "march 24" | sql_create_context |
CREATE TABLE table_name_31 (
team_s_ INTEGER,
top_goalscorer_s_ VARCHAR,
champion VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest team (s) that have tvmk as top scorer (s) and flora as the champion?
| SELECT MIN(team_s_) FROM table_name_31 WHERE top_goalscorer_s_ = "tvmk" AND champion = "flora" | sql_create_context |
CREATE TABLE table_61840 (
"Air Date" text,
"Rating" text,
"18-49" text,
"Viewers" text,
"Weekly Winner" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Viewers, when Air Date is 'July 4, 2008'?
| SELECT "Viewers" FROM table_61840 WHERE "Air Date" = 'july 4, 2008' | wikisql |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom te... | SELECT d_labitems.label FROM d_labitems WHERE d_labitems.itemid IN (SELECT labevents.itemid FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 22983) AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-173 month') ORDER BY labevents.charttime D... | mimic_iii |
CREATE TABLE table_12810 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is T4 Place Player Nick Price's Score?
| SELECT "Score" FROM table_12810 WHERE "Place" = 't4' AND "Player" = 'nick price' | wikisql |
CREATE TABLE table_59192 (
"Location" text,
"Year" real,
"Champion" text,
"Runner-up" text,
"Score" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the champion earlier than 1978 when the runner-up was Jimmy Connors?
| SELECT "Champion" FROM table_59192 WHERE "Runner-up" = 'jimmy connors' AND "Year" < '1978' | wikisql |
CREATE TABLE table_80310 (
"Rank" real,
"Lane" real,
"Name" text,
"Nationality" text,
"Time" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of lane with a rank more than 2 for Louise rnstedt?
| SELECT COUNT("Lane") FROM table_80310 WHERE "Rank" > '2' AND "Name" = 'louise ørnstedt' | wikisql |
CREATE TABLE table_203_695 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- in the irish national final for the eurovision song contest in 1990 , which artists did no... | SELECT "artist" FROM table_203_695 WHERE "points" < 75 | squall |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TA... | SELECT num.TagName AS Tag, rate.Rate AS QuestionsPerMonth FROM (SELECT COUNT(PostId) AS Rate, TagName FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate > '2015-02-01' AND Posts.CreationDate < '2015-03-01' GROUP BY TagName) AS rate INNER JOIN (SELECT COUNT(PostId) AS ... | sede |
CREATE TABLE table_54244 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Event" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which venue hosted a race in 1967?
| SELECT "Venue" FROM table_54244 WHERE "Year" = '1967' | wikisql |
CREATE TABLE table_79576 (
"Pick" real,
"Team" text,
"Player" text,
"Position" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which player is from the College of Alabama?
| SELECT "Player" FROM table_79576 WHERE "College" = 'alabama' | wikisql |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE FlagTypes (
Id number,
Name text,
Description text
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
IsUniversal boolean,
InputTitle text,
MarkdownInputGuidance text,
MarkdownPostOwner... | SELECT COUNT(c.Id) AS Comments, YEAR(c.CreationDate) AS Year_Data, YEAR(p.CreationDate) AS Post_Year_Data, p.PostTypeId FROM Comments AS c INNER JOIN Posts AS p ON p.Id = c.PostId GROUP BY YEAR(c.CreationDate), YEAR(p.CreationDate), p.PostTypeId ORDER BY 2, 3, 4 | sede |
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.BGDH FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '72522384' AND jybgb.BGRQ BETWEEN '2001-09-01' AND '2013-05-09' UNION... | css |
CREATE TABLE table_203_244 (
id number,
"pos" text,
"rider" text,
"manufacturer" text,
"time/retired" text,
"points" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many points did the first place finisher receive ?
| SELECT "points" FROM table_203_244 WHERE "pos" = 1 | squall |
CREATE TABLE table_204_101 (
id number,
"#" number,
"title" text,
"producer(s)" text,
"performer (s)" text,
"sample(s)" text,
"length" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what are the number of times e swift appears under producer... | SELECT COUNT(*) FROM table_204_101 WHERE "producer(s)" = 'e-swift' | squall |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.