instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_35704 (
"Source" text,
"Date" text,
"Fidesz" text,
"MSZP" text,
"SZDSZ" text,
"Jobbik" text,
"others" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the SZDSZ percentage with an MSZP of 25% on 25/2/2009?
| SELECT "SZDSZ" FROM table_35704 WHERE "MSZP" = '25%' AND "Date" = '25/2/2009' | wikisql |
CREATE TABLE table_name_45 (
set_2 VARCHAR,
date VARCHAR,
set_3 VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Set 2 has a Date of 25 may, and a Set 3 of 21 25?
| SELECT set_2 FROM table_name_45 WHERE date = "25 may" AND set_3 = "21–25" | sql_create_context |
CREATE TABLE Rooms (
roomName VARCHAR,
RoomId VARCHAR
)
CREATE TABLE Reservations (
Room VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Return the name and number of reservations made for each of the rooms.
| SELECT T2.roomName, COUNT(*), T1.Room FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room | sql_create_context |
CREATE TABLE ReviewTaskTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAd... | 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 program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as ... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course_offering.friday = 'N' AND course.course_id = course_offering.course_id AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'FA' ... | advising |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT AVG(t_kc22.SELF_PAY_PRO) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.MED_SER_ORG_NO = '1967584' AND t_kc22.STA_DATE BETWEEN '2010-09-13' AND '2011-04-09' | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.icd9_code = "78720" | mimicsql_data |
CREATE TABLE Fault_Log (
fault_log_entry_id INTEGER,
asset_id INTEGER,
recorded_by_staff_id INTEGER,
fault_log_entry_datetime DATETIME,
fault_description VARCHAR(255),
other_fault_details VARCHAR(255)
)
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CRE... | SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY last_name | nvbench |
CREATE TABLE table_49753 (
"City" text,
"Country" text,
"IATA" text,
"ICAO" text,
"Airport" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the airport when the iata is tbj?
| SELECT "Airport" FROM table_49753 WHERE "IATA" = 'tbj' | wikisql |
CREATE TABLE table_18534 (
"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 is the party where the incumbent is overton brooks?
| SELECT "Party" FROM table_18534 WHERE "Incumbent" = 'Overton Brooks' | wikisql |
CREATE TABLE dual_carrier (
main_airline varchar,
low_flight_number int,
high_flight_number int,
dual_airline varchar,
service_name text
)
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE airport (
airport_code varchar,
airp... | SELECT DISTINCT flight.departure_time 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 = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_33011 (
"Region" text,
"Host" text,
"Venue" text,
"City" text,
"State" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Venue is in Colorado?
| SELECT "Venue" FROM table_33011 WHERE "State" = 'colorado' | wikisql |
CREATE TABLE table_20898602_1 (
position VARCHAR,
height VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the position of the player of height ft0in (m)
| SELECT position FROM table_20898602_1 WHERE height = "ft0in (m)" | sql_create_context |
CREATE TABLE table_5301 (
"Episode No." text,
"Episode Title" text,
"UK Broadcast Date" text,
"Presenter" text,
"Countries Visited" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the broadcast date for the episode titled, 'From Hong Kong to ... | SELECT "UK Broadcast Date" FROM table_5301 WHERE "Episode Title" = 'from hong kong to ulaanbaatar' | wikisql |
CREATE TABLE table_name_99 (
bullet_weight VARCHAR,
source VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Bullet weight, when Source is hornady?
| SELECT bullet_weight FROM table_name_99 WHERE source = "hornady" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY AVG(EMPLOYEE_ID) | nvbench |
CREATE TABLE table_29779 (
"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 w... | SELECT "High points" FROM table_29779 WHERE "Date" = 'April 8' | wikisql |
CREATE TABLE table_name_86 (
player VARCHAR,
position VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a position of sg?
| SELECT player FROM table_name_86 WHERE position = "sg" | sql_create_context |
CREATE TABLE table_63559 (
"Rank" real,
"Lane" real,
"Athlete" text,
"Nationality" text,
"Time" real,
"React" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Christian Malcolm s highest react when his time was below 20.58?
| SELECT MAX("React") FROM table_63559 WHERE "Time" < '20.58' AND "Athlete" = 'christian malcolm' | wikisql |
CREATE TABLE table_1341690_35 (
candidates VARCHAR,
first_elected VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who were the candidates in the districts that was first elected in 1966?
| SELECT candidates FROM table_1341690_35 WHERE first_elected = 1966 | sql_create_context |
CREATE TABLE table_26400438_1 (
series VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In which series did Lecor Sports participate?
| SELECT series FROM table_26400438_1 WHERE team = "Lecor Sports" | sql_create_context |
CREATE TABLE table_14086 (
"Year(s)" real,
"Tournament or series" text,
"Played in" text,
"Games played ( Tests )" text,
"Games won ( Tests )" text,
"Games lost ( Tests )" text,
"Games drawn ( Tests )" text,
"Points for ( Tests )" text,
"Points against ( Tests )" text
)
-- Using va... | SELECT "Points against ( Tests )" FROM table_14086 WHERE "Year(s)" = '2000' AND "Games won ( Tests )" = '4 (1)' | wikisql |
CREATE TABLE table_name_2 (
musical_guest__song_performed_ VARCHAR,
air_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Musical Guest (Song performed) for the episode aired on 13 july 2008?
| SELECT musical_guest__song_performed_ FROM table_name_2 WHERE air_date = "13 july 2008" | sql_create_context |
CREATE TABLE repair (
repair_ID int,
name text,
Launch_Date text,
Notes text
)
CREATE TABLE technician (
technician_id real,
Name text,
Team text,
Starting_Year real,
Age int
)
CREATE TABLE machine (
Machine_ID int,
Making_Year int,
Class text,
Team text,
Machin... | SELECT Team, COUNT(*) FROM technician GROUP BY Team | nvbench |
CREATE TABLE table_25212 (
"District name" text,
"Dist. ID" real,
"ISD" text,
"County" text,
"Authorizing agency" text,
"Date opened" text,
"Services" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- If the name of the district is the Charyl S... | SELECT "County" FROM table_25212 WHERE "District name" = 'Charyl Stockwell Academy' | wikisql |
CREATE TABLE table_22754310_1 (
margin INTEGER,
party VARCHAR,
winner VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the most margin for nco party and p. ramachandran won
| SELECT MAX(margin) FROM table_22754310_1 WHERE party = "NCO" AND winner = "P. Ramachandran" | sql_create_context |
CREATE TABLE table_42057 (
"Week" real,
"Date" text,
"TV Time" text,
"Opponent" text,
"Result" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Week has a Result of l 13-16 and an Opponent of at buffalo bills?
| SELECT AVG("Week") FROM table_42057 WHERE "Result" = 'l 13-16' AND "Opponent" = 'at buffalo bills' | wikisql |
CREATE TABLE table_name_84 (
loses INTEGER,
position VARCHAR,
points VARCHAR,
goals_scored VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many loses have points greater than 30, goals scored greater than 59, with a position greater than 5?
| SELECT SUM(loses) FROM table_name_84 WHERE points > 30 AND goals_scored > 59 AND position > 5 | sql_create_context |
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE program_course.catego... | advising |
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 qtb JOIN t_kc22 ON qtb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE qtb.PERSON_ID = '98736904' AND t_kc22.STA_DATE BETWEEN '2007-01-26' AND '2015-08-06' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC LIMIT 1 UNION SELECT COUNT(*) FROM gyb JOIN t_kc22 ON gyb.MED_CLINIC_ID = t_kc22.MED_CLINIC_I... | css |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25),
COUNTRY_ID varchar(2)
)
CREATE T... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE 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 AVG(demographic.age) FROM demographic WHERE demographic.marital_status = "SINGLE" AND demographic.dob_year > "2175" | mimicsql_data |
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
)
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
-- Using valid SQLite, answer the following questions for the... | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Code | nvbench |
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND lab.itemid = "50803" | mimicsql_data |
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE icustays (
row_id number,
s... | SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26156) AND STRFTIME('%y', procedures_icd.charttime) <= '2104' ORDER BY procedures_icd.charttime LIMIT 1 | mimic_iii |
CREATE TABLE table_71503 (
"Member countries" text,
"Population" text,
"Area (km\u00b2)" text,
"GDP (billion US$)" text,
"GDP per capita (US$)" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the GDP of the nation with 56,210,000 people?
| SELECT "GDP per capita (US$)" FROM table_71503 WHERE "Population" = '56,210,000' | wikisql |
CREATE TABLE table_name_52 (
district VARCHAR,
incumbent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What district has benjamin eggleston for incumbent?
| SELECT district FROM table_name_52 WHERE incumbent = "benjamin eggleston" | 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 WHERE demographic.diagnosis = "CORONARY ARTERY DISEASE\CORONARY ARTERY BYPASS GRAFT WITH MVR; ? MAZE" AND demographic.age < "85" | mimicsql_data |
CREATE TABLE table_30110 (
"Player" text,
"Matches" real,
"Overs" text,
"Wickets" real,
"Average" text,
"Economy" text,
"BBI" text,
"4wi" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the fewest number of wickets recorded?
| SELECT MIN("Wickets") FROM table_30110 | wikisql |
CREATE TABLE table_name_33 (
overall INTEGER,
slalom VARCHAR,
season VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the highest overall prior to 1996 with a slalom of 39?
| SELECT MAX(overall) FROM table_name_33 WHERE slalom = "39" AND season < 1996 | sql_create_context |
CREATE TABLE table_name_7 (
position VARCHAR,
pick VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Tell me the position for pick of 146
| SELECT position FROM table_name_7 WHERE pick = "146" | sql_create_context |
CREATE TABLE t_kc24 (
MED_SAFE_PAY_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
REF_SLT_FLG number,
CLINIC_SLT_DATE time,
COMP_ID text,
PERSON_ID text,
FLX_MED_ORG_ID text,
INSU_TYPE text,
MED_AMOUT number,
PER_ACC_PAY number,
OVE_PAY numb... | SELECT OUT_DIAG_DIS_NM, AVG(PERSON_AGE) FROM t_kc21 WHERE MED_SER_ORG_NO = '8391729' GROUP BY OUT_DIAG_DIS_NM | css |
CREATE TABLE minor_in (
stuid number,
dno number
)
CREATE TABLE enrolled_in (
stuid number,
cid text,
grade text
)
CREATE TABLE member_of (
facid number,
dno number,
appt_type text
)
CREATE TABLE course (
cid text,
cname text,
credits number,
instructor number,
day... | SELECT room FROM faculty WHERE rank = "Professor" AND building = "NEB" | spider |
CREATE TABLE Has_Allergy (
StuID INTEGER,
Allergy VARCHAR(20)
)
CREATE TABLE Student (
StuID INTEGER,
LName VARCHAR(12),
Fname VARCHAR(12),
Age INTEGER,
Sex VARCHAR(1),
Major INTEGER,
Advisor INTEGER,
city_code VARCHAR(3)
)
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
... | SELECT Fname, COUNT(Fname) FROM Student WHERE Sex = 'F' GROUP BY Fname ORDER BY Fname DESC | nvbench |
CREATE TABLE table_204_969 (
id number,
"composer" text,
"title" text,
"genre" text,
"date" number,
"notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which composer is listed below pete doherty ?
| SELECT "composer" FROM table_204_969 WHERE id = (SELECT id FROM table_204_969 WHERE "composer" = 'pete doherty') + 1 | squall |
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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "SINGLE" AND diagnoses.long_title = "Syncope and collapse" | mimicsql_data |
CREATE TABLE table_47375 (
"Place" text,
"Player" text,
"Country" text,
"Score" real,
"To par" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When Payne Stewart of the United States scored higher than 69, what was the To Par?
| SELECT "To par" FROM table_47375 WHERE "Country" = 'united states' AND "Score" > '69' AND "Player" = 'payne stewart' | wikisql |
CREATE TABLE COURSE (
CRS_CODE varchar(10),
DEPT_CODE varchar(10),
CRS_DESCRIPTION varchar(35),
CRS_CREDIT float(8)
)
CREATE TABLE CLASS (
CLASS_CODE varchar(5),
CRS_CODE varchar(10),
CLASS_SECTION varchar(2),
CLASS_TIME varchar(20),
CLASS_ROOM varchar(8),
PROF_NUM int
)
CREATE... | SELECT STU_FNAME, SUM(STU_GPA) FROM STUDENT WHERE STU_GPA < (SELECT AVG(STU_GPA) FROM STUDENT) GROUP BY STU_FNAME | nvbench |
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 procedures (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2126.0" AND procedures.long_title = "(Aorto)coronary bypass of two coronary arteries" | mimicsql_data |
CREATE TABLE table_204_915 (
id number,
"draw" number,
"artist" text,
"song" text,
"points" number,
"place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- bernadette 's soms and which other song earned the same number of points ?
| SELECT "song" FROM table_204_915 WHERE "song" <> '"soms"' AND "points" = (SELECT "points" FROM table_204_915 WHERE "song" = '"soms"') | squall |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.QTY, t_kc22.UNIVALENT, t_kc22.AMOUNT FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_NM = '吕问筠' AND t_kc21.IN_HOSP_DATE BETWEEN '2003-03-18' AND '2004-01-26' | css |
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 TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'PHILADELPHIA' AND ground_service.city_code = city.city_code | atis |
CREATE TABLE table_name_42 (
year INTEGER,
author VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the earliest year when the author is reki kawahara?
| SELECT MIN(year) FROM table_name_42 WHERE author = "reki kawahara" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Other preterm infants, 2,000-2,499 grams" | mimicsql_data |
CREATE TABLE table_204_876 (
id number,
"ecclesiastical jurisdictions" text,
"latin name" text,
"type" text,
"rite" text,
"ecclesiastical province" text,
"established" text,
"area (km2)" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- h... | SELECT COUNT("ecclesiastical jurisdictions") FROM table_204_876 WHERE "established" < 1990 | squall |
CREATE TABLE table_204_750 (
id number,
"team" text,
"stadium" text,
"capacity" number,
"seated" number
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- which of the teams had the top number of capacity ?
| SELECT "team" FROM table_204_750 ORDER BY "capacity" DESC LIMIT 1 | squall |
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 prescriptions (
subject_id text,
hadm_id... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.age < "62" AND diagnoses.long_title = "Acute glomerulonephritis with other specified pathological lesion in kidney" | mimicsql_data |
CREATE TABLE train (
train_id number,
name text,
time text,
service text
)
CREATE TABLE train_station (
train_id number,
station_id number
)
CREATE TABLE station (
station_id number,
name text,
annual_entry_exit number,
annual_interchanges number,
total_passengers number,
... | SELECT T3.name, T3.time FROM train_station AS T1 JOIN station AS T2 ON T1.station_id = T2.station_id JOIN train AS T3 ON T3.train_id = T1.train_id WHERE T2.location = 'London' ORDER BY T3.time DESC | spider |
CREATE TABLE table_name_17 (
style VARCHAR,
choreographer_s_ VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Style, when Choreographer(s) is Dave Scott?
| SELECT style FROM table_name_17 WHERE choreographer_s_ = "dave scott" | sql_create_context |
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.BBDM, jybgb.BBMC, jybgb.BBZT FROM jybgb WHERE jybgb.BGDH = '07088619663' | css |
CREATE TABLE table_18141 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" real,
"Results" text,
"Candidates" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who's the incumbent in Florida 6?
| SELECT "Incumbent" FROM table_18141 WHERE "District" = 'Florida 6' | wikisql |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE flight (
aircraft_code_sequence text,
airline_code varchar,
airline_flight text,
arrival_time int,
connections int,
departure_time int,
dual_carrier text,
flight_days text,
... | 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 = 'NEW YORK' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'MIAM... | atis |
CREATE TABLE table_27114708_2 (
date_of_appointment VARCHAR,
team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- For team ascoli please mention all the appointment date.
| SELECT date_of_appointment FROM table_27114708_2 WHERE team = "Ascoli" | sql_create_context |
CREATE TABLE table_17715 (
"Name of System" text,
"Location" text,
"Traction Type" text,
"Date (From)" text,
"Date (To)" text,
"Notes" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many notes are form the date (from) 14 march 1910?
| SELECT COUNT("Notes") FROM table_17715 WHERE "Date (From)" = '14 March 1910' | wikisql |
CREATE TABLE table_1987 (
"Match no." real,
"Match Type" text,
"Team Europe" text,
"Score" text,
"Team USA" text,
"Progressive Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many match numbers have team europe listed as osku palermaa?... | SELECT COUNT("Match no.") FROM table_1987 WHERE "Team Europe" = 'Osku Palermaa' | wikisql |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text te... | SELECT COUNT(*) AS Users FROM Users WHERE Reputation < 15 AND Id > 0 | sede |
CREATE TABLE table_46856 (
"Sport" text,
"League" text,
"Club" text,
"Founded" real,
"Venue" text,
"League championships" real,
"Championship years" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which League championship is the lowest one t... | SELECT MIN("League championships") FROM table_46856 WHERE "Venue" = 'penn state ice pavilion' AND "Club" = 'penn state nittany lions men''s ice hockey' | wikisql |
CREATE TABLE table_test_4 (
"id" int,
"ejection_fraction_ef" int,
"systolic_blood_pressure_sbp" int,
"active_infection" bool,
"heart_disease" bool,
"renal_disease" bool,
"estimated_glomerular_filtration_rate_egfr" int,
"cardiogenic_shock" bool,
"diastolic_blood_pressure_dbp" int,
... | SELECT * FROM table_test_4 WHERE estimated_glomerular_filtration_rate_egfr < 30 | criteria2sql |
CREATE TABLE table_name_74 (
years_in_orlando VARCHAR,
school_club_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Years in Orlando has a School/Club Team of texas tech?
| SELECT years_in_orlando FROM table_name_74 WHERE school_club_team = "texas tech" | sql_create_context |
CREATE TABLE table_68047 (
"Rank" real,
"Population" real,
"Name" text,
"Former Name" text,
"Municipality" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the total number of ranks for kujalleq with former name of brattahl and population less th... | SELECT COUNT("Rank") FROM table_68047 WHERE "Municipality" = 'kujalleq' AND "Former Name" = 'brattahlíð' AND "Population" < '47' | wikisql |
CREATE TABLE book_club (
category VARCHAR,
YEAR INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- List categories that have at least two books after year 1989.
| SELECT category FROM book_club WHERE YEAR > 1989 GROUP BY category HAVING COUNT(*) >= 2 | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT COUNT(*) FROM (SELECT jybgb.KSBM FROM mzjzjlb JOIN jybgb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE mzjzjlb.YLJGDM = '8721079' AND jybgb.BGRQ BETWEEN '2006-09-08' AND '2010-10-18' GROUP BY jybgb.KSBM HAVING COUNT(*) >= 16) AS T | css |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test... | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'BIOLOGY' AND course.number = 281 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = course_offerin... | advising |
CREATE TABLE table_2896329_1 (
date VARCHAR,
handicap VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the handicap 8 st 12 lb?
| SELECT date FROM table_2896329_1 WHERE handicap = "8 st 12 lb" | sql_create_context |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Alcohol cirrhosis liver" AND lab."CATEGORY" = "Hematology" | mimicsql_data |
CREATE TABLE table_name_8 (
pick__number INTEGER,
overall VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What Average Pick # has an Overall of 296?
| SELECT AVG(pick__number) FROM table_name_8 WHERE overall = 296 | sql_create_context |
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 WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2078" | mimicsql_data |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Open reduction of fracture with internal fixation, femur" AND lab."CATEGORY" = "Blood Gas" | mimicsql_data |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | SELECT jybgb.SHRGH, jybgb.SHRXM FROM jybgb WHERE jybgb.BGDH = '07225686974' | css |
CREATE TABLE table_204_651 (
id number,
"date" text,
"championship" text,
"location" text,
"category" text,
"surface" text,
"prev. result" text,
"prev. points" number,
"new points" number,
"outcome" text
)
-- Using valid SQLite, answer the following questions for the tables pro... | SELECT SUM("new points") FROM table_204_651 | squall |
CREATE TABLE table_9992 (
"Round" real,
"Pick" real,
"Player" text,
"Nationality" text,
"College" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Player, when Round is less than 6, and when Pick is '69'?
| SELECT "Player" FROM table_9992 WHERE "Round" < '6' AND "Pick" = '69' | wikisql |
CREATE TABLE inputevents_cv (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
amount number
)
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
... | SELECT t2.drug FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 32755 AND diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'bmi 33... | mimic_iii |
CREATE TABLE table_name_54 (
director_s_ VARCHAR,
recipient VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who was the director that had a recipient of Redbag Pictures Ltd?
| SELECT director_s_ FROM table_name_54 WHERE recipient = "redbag pictures ltd" | sql_create_context |
CREATE TABLE table_39013 (
"Game" real,
"February" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Record has a Points smaller than 62 and a February larger than 16, and a Score o... | SELECT "Record" FROM table_39013 WHERE "Points" < '62' AND "February" > '16' AND "Score" = '8–7' | wikisql |
CREATE TABLE exhibition (
exhibition_id number,
year number,
theme text,
artist_id number,
ticket_price number
)
CREATE TABLE artist (
artist_id number,
name text,
country text,
year_join number,
age number
)
CREATE TABLE exhibition_record (
exhibition_id number,
date t... | SELECT COUNT(*) FROM artist | spider |
CREATE TABLE table_66216 (
"Rank" real,
"Athlete" text,
"Country" text,
"Day 1" real,
"Total" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who had a rank under 17 with a total of 119?
| SELECT "Athlete" FROM table_66216 WHERE "Rank" < '17' AND "Total" = '119' | wikisql |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "S/P HANGING" AND demographic.dob_year < "2123" | mimicsql_data |
CREATE TABLE table_29020 (
"Pick #" real,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What number pick was the player from HIFK Helsinki (Finland)... | SELECT "Pick #" FROM table_29020 WHERE "College/junior/club team" = 'HIFK Helsinki (Finland)' | wikisql |
CREATE TABLE table_name_24 (
year INTEGER,
notes VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Year, when Notes is '5.19km, 18controls'?
| SELECT MIN(year) FROM table_name_24 WHERE notes = "5.19km, 18controls" | sql_create_context |
CREATE TABLE table_name_50 (
diameter__km_ INTEGER,
latitude VARCHAR,
year_named VARCHAR,
longitude VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the diameter for 1997 when longitude is 212.0e and latitude is 47.0n?
| SELECT MIN(diameter__km_) FROM table_name_50 WHERE year_named = 1997 AND longitude = "212.0e" AND latitude = "47.0n" | sql_create_context |
CREATE TABLE table_2453 (
"N\u00ba" real,
"Cabinet (Nickname)" text,
"Took office" text,
"Left office" text,
"Duration" text,
"Coalition parties" text,
"ministers" text,
"ministries" real,
"King" text
)
-- Using valid SQLite, answer the following questions for the tables provided a... | SELECT MAX("ministries") FROM table_2453 | wikisql |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE ReviewTas... | SELECT Id AS "post_link", upvotes, downvotes, Score, (upvotes + (AVG(upvotes) OVER ())) / (upvotes + downvotes + (AVG(upvotes + downvotes) OVER ())) AS br FROM (SELECT p.Id, COUNT(CASE v.VoteTypeId WHEN 2 THEN 1 ELSE NULL END) AS upvotes, COUNT(CASE v.VoteTypeId WHEN 3 THEN 1 ELSE NULL END) AS downvotes, MAX(p.Score) A... | sede |
CREATE TABLE table_30888 (
"Code" text,
"Subdivision name ( be ) (BGN/PCGN)" text,
"Subdivision name ( be ) (GOST)" text,
"Subdivision name ( ru ) (BGN/PCGN)" text,
"Subdivision name ( ru ) (GOST)" text,
"Subdivision category" text
)
-- Using valid SQLite, answer the following questions for th... | SELECT "Code" FROM table_30888 WHERE "Subdivision name ( be ) (BGN/PCGN)" = 'Homyel''skaya voblasts' | wikisql |
CREATE TABLE Skills_Required_To_Fix (
part_fault_id INTEGER,
skill_id INTEGER
)
CREATE TABLE Skills (
skill_id INTEGER,
skill_code VARCHAR(20),
skill_description VARCHAR(255)
)
CREATE TABLE Part_Faults (
part_fault_id INTEGER,
part_id INTEGER,
fault_short_name VARCHAR(20),
fault_de... | SELECT last_name, COUNT(last_name) FROM Staff AS T1 JOIN Engineer_Visits AS T2 ON T1.staff_id = T2.contact_staff_id JOIN Maintenance_Engineers AS T3 ON T2.engineer_id = T3.engineer_id GROUP BY last_name ORDER BY COUNT(last_name) DESC | nvbench |
CREATE TABLE table_name_23 (
tv_time VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which TV Time has a Date of january 2, 2005?
| SELECT tv_time FROM table_name_23 WHERE date = "january 2, 2005" | sql_create_context |
CREATE TABLE table_30574 (
"School" text,
"Gender" text,
"Age Range" text,
"Religious Affiliation" text,
"Location" text,
"School website" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the gender of the school which has the website http... | SELECT "Gender" FROM table_30574 WHERE "School website" = 'http://www.nicholasbreakspearschool.co.uk/' | wikisql |
CREATE TABLE table_44119 (
"Rank" real,
"Title" text,
"Studio" text,
"Director" text,
"Gross" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the rank of the film directed by Kevin Costner?
| SELECT COUNT("Rank") FROM table_44119 WHERE "Director" = 'kevin costner' | wikisql |
CREATE TABLE table_46062 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- 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_46062 WHERE "October" = '19' | wikisql |
CREATE TABLE fgwyjzb (
CLINIC_ID text,
CLINIC_TYPE text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
... | SELECT SUM(gwyjzb.MED_AMOUT) FROM gwyjzb WHERE gwyjzb.PERSON_ID = '84583960' AND gwyjzb.CLINIC_TYPE = '门诊' UNION SELECT SUM(fgwyjzb.MED_AMOUT) FROM fgwyjzb WHERE fgwyjzb.PERSON_ID = '84583960' AND fgwyjzb.CLINIC_TYPE = '门诊' | css |
CREATE TABLE table_name_15 (
craft VARCHAR,
location VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Craft used at Coniston Water?
| SELECT craft FROM table_name_15 WHERE location = "coniston water" | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.