instruction stringlengths 151 7.46k | output stringlengths 2 4.44k | source stringclasses 26
values |
|---|---|---|
CREATE TABLE table_2249029_1 (
gdp_per_capita VARCHAR,
gdp_world_rank VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the gdp per capita for world rank being 131
| SELECT gdp_per_capita FROM table_2249029_1 WHERE gdp_world_rank = "131" | sql_create_context |
CREATE TABLE table_name_43 (
week INTEGER,
opponent VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- In what Week is the Opponent the New Orleans Saints?
| SELECT AVG(week) FROM table_name_43 WHERE opponent = "new orleans saints" | sql_create_context |
CREATE TABLE table_12451376_2 (
title VARCHAR,
season_2_ep__number VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Please give me the title of Season 2, episode 1.
| SELECT title FROM table_12451376_2 WHERE season_2_ep__number = 1 | sql_create_context |
CREATE TABLE table_name_20 (
population INTEGER,
colour VARCHAR,
construction_commenced VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest population for the neighborhood with the color blue that commenced its construction before 1987?
| SELECT MIN(population) FROM table_name_20 WHERE colour = "blue" AND construction_commenced < 1987 | sql_create_context |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id number
)
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
... | SELECT jybgb.BBCJBW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN hz_info_mzjzjlb ON hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_in... | css |
CREATE TABLE table_78816 (
"Week" real,
"Team" text,
"Carries" real,
"Yards" real,
"Average" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Team has 19 Carries, and a Week larger than 13?
| SELECT "Team" FROM table_78816 WHERE "Carries" = '19' AND "Week" > '13' | wikisql |
CREATE TABLE table_26431 (
"Profile" text,
"Bandwidth ( MHz )" text,
"Number of carriers" real,
"Carrier bandwidth (kHz)" text,
"Power ( dBm )" text,
"Max. downstream throughput ( Mbit/s )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is ... | SELECT MIN("Number of carriers") FROM table_26431 | wikisql |
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 * FROM t_kc21 WHERE PERSON_NM = '戚欣合' AND MED_SER_ORG_NO = '5382017' AND MED_ORG_DEPT_NM LIKE '%肾科%' | css |
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,
flight_id int,
flight_number int,
from_airport varchar,
meal_code text,
stops int,... | SELECT DISTINCT class_of_service.booking_class FROM class_of_service, fare, fare_basis, flight, flight_fare WHERE fare_basis.booking_class = class_of_service.booking_class AND fare.fare_basis_code = fare_basis.fare_basis_code AND flight_fare.fare_id = fare.fare_id AND flight.airline_code = 'TW' AND flight.flight_id = f... | atis |
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),
AllergyType VARCHAR(20)
)
CREATE TABLE Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType | nvbench |
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 INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.charttime = "2133-08-01 12:06:00" | mimicsql_data |
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE admissions (
row_id number,
subject_id number,
... | SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', prescriptions.startdate)) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 8888 AND admissions.dischtime IS NULL) AND prescriptions.drug = 'furosemide' ORDER BY prescriptions.startdate ... | mimic_iii |
CREATE TABLE table_name_83 (
played VARCHAR,
against VARCHAR,
lost VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many played has an against greater than 57 and a lost bigger than 14?
| SELECT COUNT(played) FROM table_name_83 WHERE against > 57 AND lost > 14 | sql_create_context |
CREATE TABLE table_64674 (
"Draw" real,
"Language" text,
"Artist" text,
"Song" text,
"English translation" text,
"Place" real,
"Points" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the points are 98 what is the draw?
| SELECT COUNT("Draw") FROM table_64674 WHERE "Points" = '98' | wikisql |
CREATE TABLE Parties_in_Events (
Party_ID INTEGER,
Event_ID INTEGER,
Role_Code CHAR(15)
)
CREATE TABLE Products (
Product_ID INTEGER,
Product_Type_Code CHAR(15),
Product_Name VARCHAR(255),
Product_Price DECIMAL(20,4)
)
CREATE TABLE Agreements (
Document_ID INTEGER,
Event_ID INTEGER... | SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_1 (
series VARCHAR,
release_date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Series of the Filmography with Release date of 1946-01-05?
| SELECT series FROM table_name_1 WHERE release_date = "1946-01-05" | sql_create_context |
CREATE TABLE hz_info (
KH text,
KLX number,
RYBH text,
YLJGDM text
)
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,
... | SELECT jybgb.BGDH FROM hz_info JOIN wdmzjzjlb JOIN jybgb ON hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX AND wdmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND wdmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.RYBH = '94379213' AND NOT jybgb.BGDH IN (SELECT jyjgzbb.BGDH FRO... | css |
CREATE TABLE table_68435 (
"Season" real,
"Date" text,
"Location" text,
"Race" text,
"Place" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which race resulted in 2nd place in the 1996 season on 20-Jan-1996?
| SELECT "Race" FROM table_68435 WHERE "Place" = '2nd' AND "Season" = '1996' AND "Date" = '20-jan-1996' | wikisql |
CREATE TABLE table_75611 (
"Game" real,
"October" real,
"Opponent" text,
"Score" text,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the average game with a record of 4-4-0?
| SELECT AVG("Game") FROM table_75611 WHERE "Record" = '4-4-0' | wikisql |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type text,
admission_location text,
discharge_location text,
insurance text,
lan... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'ccu' AND DATETIME(transfers.intime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')) | mimic_iii |
CREATE TABLE Faculty (
FacID INTEGER,
Lname VARCHAR(15),
Fname VARCHAR(15),
Rank VARCHAR(15),
Sex VARCHAR(1),
Phone INTEGER,
Room VARCHAR(5),
Building VARCHAR(13)
)
CREATE TABLE Department (
DNO INTEGER,
Division VARCHAR(2),
DName VARCHAR(25),
Room VARCHAR(5),
Buildi... | SELECT T1.CName, COUNT(T1.CName) FROM Course AS T1 JOIN Enrolled_in AS T2 ON T1.CID = T2.CID GROUP BY T1.CName, T2.CID HAVING COUNT(*) >= 5 | nvbench |
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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2165" AND lab.itemid = "50990" | mimicsql_data |
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_DIRE_CD text,
MED_DIRE_NM text,... | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '77275514' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 9201.03) | css |
CREATE TABLE election (
election_id number,
representative_id number,
date text,
votes number,
vote_percent number,
seats number,
place number
)
CREATE TABLE representative (
representative_id number,
name text,
state text,
party text,
lifespan text
)
-- Using valid SQ... | SELECT party FROM representative WHERE state = "New York" INTERSECT SELECT party FROM representative WHERE state = "Pennsylvania" | spider |
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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.marital_status = "WIDOWED" AND diagnoses.long_title = "Obstructive chronic bronchitis with (acute) exacerbation" | mimicsql_data |
CREATE TABLE table_49131 (
"Team" text,
"City" text,
"State/Province" text,
"League" text,
"Est." text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which team is located in missouri and was established in 1963?
| SELECT "Team" FROM table_49131 WHERE "State/Province" = 'missouri' AND "Est." = '1963' | wikisql |
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 Name, AVG(Num_Employees) FROM department AS T1 JOIN management AS T2 ON T1.department_ID = T2.department_ID WHERE T2.temporary_acting = 'Yes' GROUP BY Name | nvbench |
CREATE TABLE artist (
Artist_ID int,
Name text,
Country text,
Year_Join int,
Age int
)
CREATE TABLE exhibition_record (
Exhibition_ID int,
Date text,
Attendance int
)
CREATE TABLE exhibition (
Exhibition_ID int,
Year int,
Theme text,
Artist_ID int,
Ticket_Price real... | SELECT Name, COUNT(*) FROM exhibition AS T1 JOIN artist AS T2 ON T1.Artist_ID = T2.Artist_ID GROUP BY T1.Artist_ID | nvbench |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE d_items (
row_id number,
itemid number,
label text,
linksto text
)
CREATE TABLE diagnoses_icd (
row_id number,
... | SELECT COUNT(*) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19691) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_79995 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What place did the player from England come in?
| SELECT "Place" FROM table_79995 WHERE "Country" = 'england' | wikisql |
CREATE TABLE table_204_800 (
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.
-- which nations won only bronze medals ?
| SELECT "nation" FROM table_204_800 WHERE "bronze" = "total" | squall |
CREATE TABLE table_2104176_1 (
distinguished_service_cross VARCHAR,
navy_cross VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the distinguished service cross when the navy cross is Coast Guard commendation medal?
| SELECT distinguished_service_cross FROM table_2104176_1 WHERE navy_cross = "Coast Guard Commendation Medal" | sql_create_context |
CREATE TABLE table_7462 (
"Type" text,
"Name" text,
"Title" text,
"Political group" text,
"From" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the Type for l. publilius philo vulscus?
| SELECT "Type" FROM table_7462 WHERE "Name" = 'l. publilius philo vulscus' | wikisql |
CREATE TABLE table_26847 (
"Governorate" text,
"Kurdistan Democratic Party" real,
"Patriotic Union of Kurdistan" real,
"Total Kurdistan List" real,
"Total Governorate Seats" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the kurdistan democrati... | SELECT MIN("Kurdistan Democratic Party") FROM table_26847 WHERE "Total Kurdistan List" = '10' | wikisql |
CREATE TABLE ref_product_categories (
product_category_code text,
product_category_description text,
unit_of_measure text
)
CREATE TABLE ref_colors (
color_code text,
color_description text
)
CREATE TABLE characteristics (
characteristic_id number,
characteristic_type_code text,
charac... | SELECT t2.color_description FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code GROUP BY t2.color_description ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_69 (
lost INTEGER,
_percentage_pts INTEGER
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When the points scored was over 110.25%, what's the average amount lost?
| SELECT AVG(lost) FROM table_name_69 WHERE _percentage_pts > 110.25 | 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 COUNT(*) FROM zyjzjlb WHERE YLJGDM = '3461022' AND RYDJSJ > '2003-06-23' | css |
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden boolean,
Predefined boolean,
PostNoticeDurationId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
VoteTypeId number,
CreationDate time
)
CREATE T... | COMMIT | sede |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
... | SELECT HIRE_DATE, SALARY FROM employees WHERE HIRE_DATE < '2002-06-21' | nvbench |
CREATE TABLE table_62309 (
"Season" real,
"Team" text,
"Country" text,
"League" text,
"Level" real,
"Apps" real,
"Goals" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Apps with more than 1 level?
| SELECT MIN("Apps") FROM table_62309 WHERE "Level" > '1' | wikisql |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "HYPERTENSION;RULE OUT CORONARY ARTERY DISEASE\CARDIAC CATH" AND lab."CATEGORY" = "Chemistry" | mimicsql_data |
CREATE TABLE flight_fare (
flight_id int,
fare_id int
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
round_trip_required varchar
)
CREA... | 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 = 'PHOENIX' AND date_day.day_number = 21 AND date_day.month_number = 2 AND ... | atis |
CREATE TABLE table_1046170_5 (
division VARCHAR,
us_open_cup VARCHAR,
year VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many division did not qualify for u.s. open cup in 2003
| SELECT division FROM table_1046170_5 WHERE us_open_cup = "Did Not Qualify" AND year = 2003 | sql_create_context |
CREATE TABLE state (
state_code text,
state_name text,
country_name text
)
CREATE TABLE code_description (
code varchar,
description text
)
CREATE TABLE airport_service (
city_code varchar,
airport_code varchar,
miles_distant int,
direction varchar,
minutes_distant int
)
CREAT... | 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, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.... | atis |
CREATE TABLE table_68745 (
"Language" text,
"Number" text,
"percentage (%)" text,
"males" text,
"females" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which number has 11 males?
| SELECT "Number" FROM table_68745 WHERE "males" = '11' | wikisql |
CREATE TABLE chartevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
itemid number,
charttime time,
valuenum number,
valueuom text
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
short_title text,
long_title text
)
CREATE TABL... | SELECT d_items.label FROM d_items WHERE d_items.itemid IN (SELECT outputevents.itemid FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 53863)) AND STRFTIME('%y-%m-%d', outputeve... | mimic_iii |
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, Team_ID FROM basketball_match ORDER BY All_Neutral DESC | nvbench |
CREATE TABLE table_name_5 (
home_team VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How much did the home team Hawthorn score?
| SELECT home_team AS score FROM table_name_5 WHERE home_team = "hawthorn" | sql_create_context |
CREATE TABLE table_name_25 (
carrier VARCHAR,
package_version VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT IS THE CARRIER FOR 4.7.0.208 VERSION?
| SELECT carrier FROM table_name_25 WHERE package_version = "4.7.0.208" | sql_create_context |
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
zip int
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course_prerequisite (
pre_course_id ... | SELECT DISTINCT advisory_requirement FROM course WHERE department = 'MILSCI' AND number = 302 | advising |
CREATE TABLE Allergy_Type (
Allergy VARCHAR(20),
AllergyType 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 Has_Allergy (
StuID INTEGE... | SELECT AllergyType, COUNT(*) FROM Has_Allergy AS T1 JOIN Allergy_Type AS T2 ON T1.Allergy = T2.Allergy GROUP BY T2.AllergyType ORDER BY AllergyType | nvbench |
CREATE TABLE table_36552 (
"Year" real,
"Title" text,
"Format" text,
"Label" text,
"Catalogno" text,
"Remark" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What title had a remark of #21 us [riaa certified gold january 3, 1990]?
| SELECT "Title" FROM table_36552 WHERE "Remark" = '#21 us [riaa certified gold january 3, 1990]' | wikisql |
CREATE TABLE table_204_350 (
id number,
"date" text,
"opponents" text,
"venue" text,
"result" text,
"scorers" text,
"attendance" number,
"report 1" text,
"report 2" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the number of... | SELECT "attendance" FROM table_204_350 WHERE "date" = '30-jan-68' | squall |
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.days_stay > "3" AND prescriptions.drug = "Morphine Sulfate SR" | 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.admission_type = "NEWBORN" AND demographic.ethnicity = "BLACK/CAPE VERDEAN" | mimicsql_data |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
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 TAB... | 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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DEN... | atis |
CREATE TABLE zyb (
CLINIC_ID 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,
INSU_TYPE text,
IN... | SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '杨星波' AND qtb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 3838.71) UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '杨星波' AND gyb.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT >= 383... | css |
CREATE TABLE table_76267 (
"Governorate" text,
"Capital City" text,
"Area km\u00b2" real,
"Pop (2004)" real,
"Map Key" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Count the sum of Pop (2004) which has a Governorate of al mahrah with an Area km sm... | SELECT SUM("Pop (2004)") FROM table_76267 WHERE "Governorate" = 'al mahrah' AND "Area km\u00b2" < '78,073' | wikisql |
CREATE TABLE table_name_97 (
angle_from_center_ VARCHAR,
taper VARCHAR,
ft VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Angle from center/ has a Taper/ft smaller than 0.6000000000000001?
| SELECT COUNT(angle_from_center_) AS ° FROM table_name_97 WHERE taper / ft < 0.6000000000000001 | sql_create_context |
CREATE TABLE table_8284 (
"Player" text,
"PL Apps" real,
"PL G" real,
"CL Apps" real,
"CL G" real,
"FAC / LC Apps" real,
"FAC / LC G" real,
"Total Apps" real,
"Total G" real,
"FA YC" real,
"UEFA YC" real
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT SUM("FAC / LC G") FROM table_8284 WHERE "CL G" < '2' AND "Total Apps" < '5' AND "UEFA YC" > '0' | wikisql |
CREATE TABLE has_amenity (
dormid number,
amenid number
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE dorm_amenity (
amenid number,
amenity_name text
)
CREATE TABLE lives... | SELECT AVG(student_capacity), SUM(student_capacity) FROM dorm WHERE gender = 'X' | spider |
CREATE TABLE table_name_40 (
result VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is Result, when Date is 19 August 1992?
| SELECT result FROM table_name_40 WHERE date = "19 august 1992" | sql_create_context |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE ReviewTaskResults (
... | WITH a AS (SELECT p.Id, COUNT(v.PostId) AS n_votes FROM Votes AS v FULL OUTER JOIN Posts AS p ON v.PostId = p.Id WHERE p.PostTypeId IN (1) AND v.VoteTypeId IN (2, 3) GROUP BY p.Id), b AS (SELECT pp.Id, n_votes FROM a FULL OUTER JOIN Posts AS pp ON a.Id = pp.Id WHERE pp.PostTypeId IN (1)) SELECT * FROM b ORDER BY Id DES... | sede |
CREATE TABLE semester (
semester_id int,
semester varchar,
year int
)
CREATE TABLE course_tags_count (
course_id int,
clear_grading int,
pop_quiz int,
group_projects int,
inspirational int,
long_lectures int,
extra_credit int,
few_tests int,
good_feedback int,
tough_... | SELECT COUNT(instructor.name), instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'PUBPOL' AND course.number = 456 AND offering_instructor.instructor_id = instructor.instructor_id AND offering_instructor.offering_id = ... | advising |
CREATE TABLE table_2472711_32 (
up_down VARCHAR,
venue VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the up/down associated with the Subiaco Oval?
| SELECT up_down FROM table_2472711_32 WHERE venue = "Subiaco Oval" | sql_create_context |
CREATE TABLE table_64824 (
"Name (pinyin)" text,
"Name (Wade Giles)" text,
"Characters" text,
"Type" text,
"Construction" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who has a Construction of 1870, foochow navy yard, and a Name (Wade Giles) of fu... | SELECT "Characters" FROM table_64824 WHERE "Construction" = '1870, foochow navy yard' AND "Name (Wade Giles)" = 'fu-hsing' | wikisql |
CREATE TABLE table_203_689 (
id number,
"date" text,
"opponent" text,
"score" text,
"result" text,
"record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what was the total number of loses ?
| SELECT COUNT(*) FROM table_203_689 WHERE "result" = 'loss' | squall |
CREATE TABLE table_name_64 (
feature VARCHAR,
driving_force_pro VARCHAR,
driving_force_ex VARCHAR,
driving_force_gt VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Driving Force EX of no, and a Driving Force GT of yes, and a Driving Force Pro of yes h... | SELECT feature FROM table_name_64 WHERE driving_force_ex = "no" AND driving_force_gt = "yes" AND driving_force_pro = "yes" | sql_create_context |
CREATE TABLE gsi (
course_offering_id int,
student_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABL... | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'BE' AND course.number = 502 AND semester.semester = 'FA' AND semester.semester_id = course_offering.semester AND semester.year = 2016 | advising |
CREATE TABLE table_24606 (
"Week" real,
"Date" text,
"Opponent" text,
"Location" text,
"Final Score" text,
"Attendance" real,
"Record" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What was the final score when the attendance was 25598?
| SELECT "Final Score" FROM table_24606 WHERE "Attendance" = '25598' | wikisql |
CREATE TABLE hz_info_mzjzjlb (
JZLSH number,
YLJGDM number,
mzjzjlb_id 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 jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN hz_info_mzjzjlb ON hz_info_mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM ... | css |
CREATE TABLE table_name_53 (
react INTEGER,
lane VARCHAR,
time VARCHAR,
nationality VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Name the average React of the Time smaller than 20.05 in jamaica with a Lane larger than 5?
| SELECT AVG(react) FROM table_name_53 WHERE time < 20.05 AND nationality = "jamaica" AND lane > 5 | sql_create_context |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE jobs (
job_id int,
job_title varchar,
description varchar,
requirement varchar,
city varchar,
state varchar,
country varchar,
... | SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'ANTHRCUL' AND course.number = 375 AND semester.semester <> 'Fall' | advising |
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, School_ID FROM basketball_match GROUP BY All_Home, ACC_Road ORDER BY School_ID DESC | nvbench |
CREATE TABLE table_name_55 (
country VARCHAR,
notes VARCHAR,
time VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has sa/b as the notes, and a time of 5:51.30?
| SELECT country FROM table_name_55 WHERE notes = "sa/b" AND time = "5:51.30" | sql_create_context |
CREATE TABLE table_204_978 (
id number,
"position" number,
"nation" number,
"number" number,
"name" text,
"soproni liga" number,
"uefa cup" number,
"hungarian cup" number,
"league cup" number,
"total" number
)
-- Using valid SQLite, answer the following questions for the tables... | SELECT "total" FROM table_204_978 WHERE "name" = 'zoltan kiss' | squall |
CREATE TABLE table_204_974 (
id number,
"season" number,
"level" text,
"division" text,
"section" text,
"administration" text,
"position" text,
"movements" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- how many times were they in tier 3... | SELECT COUNT(*) FROM table_204_974 WHERE "level" = 'tier 3' | squall |
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 procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.icd9_code = "331" | mimicsql_data |
CREATE TABLE table_68321 (
"Name of Ship" text,
"Length" text,
"Max speed" text,
"Crew/Capacity" text,
"Class" text,
"Builder" text,
"Delivery" real
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Who built the ship that is 42.8 m long and was del... | SELECT "Builder" FROM table_68321 WHERE "Length" = '42.8 m' AND "Delivery" = '2007' | wikisql |
CREATE TABLE table_name_89 (
to_par VARCHAR,
score VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the To par of the Player with a Score of 73-67-68=208?
| SELECT to_par FROM table_name_89 WHERE score = 73 - 67 - 68 = 208 | sql_create_context |
CREATE TABLE table_name_45 (
country VARCHAR,
format VARCHAR,
catalog VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What country has CD format and catalog RCD 10523?
| SELECT country FROM table_name_45 WHERE format = "cd" AND catalog = "rcd 10523" | sql_create_context |
CREATE TABLE table_78777 (
"Edition" text,
"Date" text,
"Winner" text,
"Country" text,
"Time ( h : m : s )" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- On what date was the 48th Edition raced?
| SELECT "Date" FROM table_78777 WHERE "Edition" = '48th' | wikisql |
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 COUNT(DISTINCT IN_DIAG_DIS_CD) FROM t_kc21 WHERE PERSON_ID = '23539348' AND IN_HOSP_DATE BETWEEN '2016-10-28' AND '2017-09-19' | css |
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 TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE T... | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE SALARY > (SELECT MAX(SALARY) FROM employees WHERE JOB_ID = 'PU_MAN') GROUP BY JOB_ID | nvbench |
CREATE TABLE DEPARTMENT (
DEPT_CODE varchar(10),
DEPT_NAME varchar(30),
SCHOOL_CODE varchar(8),
EMP_NUM int,
DEPT_ADDRESS varchar(20),
DEPT_EXTENSION varchar(4)
)
CREATE TABLE EMPLOYEE (
EMP_NUM int,
EMP_LNAME varchar(15),
EMP_FNAME varchar(12),
EMP_INITIAL varchar(1),
EMP_J... | SELECT CRS_DESCRIPTION, COUNT(CRS_DESCRIPTION) FROM CLASS AS T1 JOIN EMPLOYEE AS T2 ON T1.PROF_NUM = T2.EMP_NUM JOIN COURSE AS T3 ON T1.CRS_CODE = T3.CRS_CODE JOIN PROFESSOR AS T4 ON T2.EMP_NUM = T4.EMP_NUM GROUP BY CRS_DESCRIPTION ORDER BY CRS_DESCRIPTION | nvbench |
CREATE TABLE table_name_95 (
loss INTEGER,
name VARCHAR,
long VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- What is the lowest Loss for the player named total that has a long greater than 55?
| SELECT MIN(loss) FROM table_name_95 WHERE name = "total" AND long > 55 | 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 WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Chronic obstructive asthma, unspecified" | mimicsql_data |
CREATE TABLE teaches (
ID varchar(5),
course_id varchar(8),
sec_id varchar(8),
semester varchar(6),
year numeric(4,0)
)
CREATE TABLE advisor (
s_ID varchar(5),
i_ID varchar(5)
)
CREATE TABLE prereq (
course_id varchar(8),
prereq_id varchar(8)
)
CREATE TABLE takes (
ID varchar(... | SELECT year, COUNT(*) FROM section GROUP BY semester, year | nvbench |
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 t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM, t_kc22.AMOUNT FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '52743423301' AND t_kc22.SOC_SRT_DIRE_NM LIKE '%乳胶%' | css |
CREATE TABLE table_36510 (
"Round" real,
"Pick" real,
"Player" text,
"Position" text,
"School/Club Team" text
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- How many Pick has a Round smaller than 13, and a Position of fullback?
| SELECT COUNT("Pick") FROM table_36510 WHERE "Round" < '13' AND "Position" = 'fullback' | wikisql |
CREATE TABLE table_name_22 (
level VARCHAR,
domestic_cup VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which level is quarterfinals domestic cup?
| SELECT level FROM table_name_22 WHERE domestic_cup = "quarterfinals" | sql_create_context |
CREATE TABLE table_name_97 (
year VARCHAR,
champion VARCHAR,
date VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- WHAT YEAR WAS ROBERT COOMBES CHAMPION ON MAY 7?
| SELECT COUNT(year) FROM table_name_97 WHERE champion = "robert coombes" AND date = "may 7" | sql_create_context |
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 text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
C... | SELECT MIN(demographic.age) FROM demographic WHERE demographic.discharge_location = "DISCH-TRAN TO PSYCH HOSP" AND demographic.diagnosis = "ANGIOEDEMA" | mimicsql_data |
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 mzjzjlb.JZLSH FROM person_info JOIN hz_info JOIN mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX WHERE person_info.XM = '韦宏放' AND hz_info.YLJGDM = '9529640' AND NOT mzjzjlb.JZKSMC LIKE '%补牙%' | css |
CREATE TABLE table_186468_1 (
property VARCHAR,
ka_band VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- When 2 is the ka-band how many properties are there?
| SELECT COUNT(property) FROM table_186468_1 WHERE ka_band = "2" | sql_create_context |
CREATE TABLE table_name_60 (
monarch VARCHAR,
status VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- Which Monarch has succession unclear 1100-1103 as his Status?
| SELECT monarch FROM table_name_60 WHERE status = "succession unclear 1100-1103" | sql_create_context |
CREATE TABLE table_name_29 (
top_5 INTEGER,
wins VARCHAR,
top_25 VARCHAR,
cuts_made VARCHAR
)
-- Using valid SQLite, answer the following questions for the tables provided above.
-- what is the highest top-5 when the top-25 is less than 4, cuts made is more than 3 and wins is 0?
| SELECT MAX(top_5) FROM table_name_29 WHERE top_25 < 4 AND cuts_made > 3 AND wins < 0 | sql_create_context |
CREATE TABLE prescriptions (
subject_id text,
hadm_id text,
icustay_id text,
drug_type text,
drug text,
formulary_drug_cd text,
route text,
drug_dose text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.short_title = "Gastrointest hemorr NOS" | mimicsql_data |
CREATE TABLE table_71199 (
"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.
-- Which event resulted in loss with an Opponent of ma... | SELECT "Event" FROM table_71199 WHERE "Res." = 'loss' AND "Opponent" = 'maurice smith' | wikisql |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Blood" | mimicsql_data |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.