context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE t_kc21 (
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,
... | 把2015年12月26日到2016年2月29日期间患者33874140一共做过多少次检查查看一下 | SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE t_kc21.PERSON_ID = '33874140' AND t_kc22.STA_DATE BETWEEN '2015-12-26' AND '2016-02-29' AND t_kc22.MED_INV_ITEM_TYPE = '检查费' | css |
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
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),
CO... | For all employees who have the letters D or S in their first name, show me about the distribution of hire_date and the average of manager_id bin hire_date by weekday in a bar chart, and I want to order by the y-axis in asc please. | SELECT HIRE_DATE, AVG(MANAGER_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY AVG(MANAGER_ID) | nvbench |
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid number,
wardid number,
admissionheight number,
admissionweight number,
dischargeweight number,
hospitaladmittime time,
... | how much does it cost for intracranial venous thrombosis - lateral sinus to be diagnosed? | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'diagnosis' AND cost.eventid IN (SELECT diagnosis.diagnosisid FROM diagnosis WHERE diagnosis.diagnosisname = 'intracranial venous thrombosis - lateral sinus') | eicu |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE demographic ... | count the number of patients whose discharge location is home and diagnoses short title is diabetic retinopathy nos? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.discharge_location = "HOME" AND diagnoses.short_title = "Diabetic retinopathy NOS" | mimicsql_data |
CREATE TABLE table_27932399_1 (
catalogue_number VARCHAR,
release_date VARCHAR,
artist VARCHAR
) | What is the catalogue number for release dates of exactly 2005 and released by The Clear Spots? | SELECT catalogue_number FROM table_27932399_1 WHERE release_date = 2005 AND artist = "The Clear Spots" | sql_create_context |
CREATE TABLE competition (
Competition_ID int,
Year real,
Competition_type text,
Country text
)
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Total... | Return a histogram on what are the types of competition and number of competitions for that type?, and list by the names from low to high. | SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type ORDER BY Competition_type | nvbench |
CREATE TABLE program (
program_id int,
name varchar,
college varchar,
introduction varchar
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additional_req varchar
)
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE gsi (
c... | What is the name of the professor teaching Other class next Winter ? | 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 table_8840 (
"Model Number" text,
"Frequency" text,
"L2-Cache" text,
"Front Side Bus" text,
"Multiplier" text,
"Voltage" text,
"Socket" text
) | Which Front Side Bus has a Voltage of 1.4 v, and a Frequency of 1333 mhz? | SELECT "Front Side Bus" FROM table_8840 WHERE "Voltage" = '1.4 v' AND "Frequency" = '1333 mhz' | wikisql |
CREATE TABLE culture_company (
Company_name text,
Type text,
Incorporated_in text,
Group_Equity_Shareholding real,
book_club_id text,
movie_id text
)
CREATE TABLE book_club (
book_club_id int,
Year int,
Author_or_Editor text,
Book_Title text,
Publisher text,
Category tex... | Show all book categories and the number of books in each category with a bar chart, and order by the the total number from high to low. | SELECT Category, COUNT(*) FROM book_club GROUP BY Category ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE table_name_68 (
europe VARCHAR,
head_coach VARCHAR,
regional_competitions VARCHAR
) | WHAT IS THE ERUPE WITH HEAD COACH vainauskas , sakalauskas AND WITH NEBL FINALIST? | SELECT europe FROM table_name_68 WHERE head_coach = "vainauskas , sakalauskas" AND regional_competitions = "nebl finalist" | sql_create_context |
CREATE TABLE table_34311 (
"Position" text,
"Name" text,
"School" text,
"Unanimous" text,
"College Hall of Fame" text
) | What Position has no College Hall of Fame? | SELECT "Position" FROM table_34311 WHERE "College Hall of Fame" = 'no' | wikisql |
CREATE TABLE table_41430 (
"Position" text,
"Jersey #" real,
"Name" text,
"Height (cm)" real,
"Weight (kg)" real,
"Birthdate" text,
"Birthplace" text,
"1986\u20131987 Team" text
) | What is the height of the player born on June 24, 1964, with a weight over 84 kg? | SELECT AVG("Height (cm)") FROM table_41430 WHERE "Weight (kg)" > '84' AND "Birthdate" = 'june 24, 1964' | wikisql |
CREATE TABLE ReviewTaskResults (
Id number,
ReviewTaskId number,
ReviewTaskResultTypeId number,
CreationDate time,
RejectionReasonId number,
Comment text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate tim... | Get data from all recent posts. | SELECT Id, Score, ViewCount, AnswerCount FROM Posts WHERE PostTypeId = 2 AND YEAR(CreationDate) > 2015 | sede |
CREATE TABLE Manufacturers (
Code INTEGER,
Name VARCHAR(255),
Headquarter VARCHAR(255),
Founder VARCHAR(255),
Revenue REAL
)
CREATE TABLE Products (
Code INTEGER,
Name VARCHAR(255),
Price DECIMAL,
Manufacturer INTEGER
) | For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the headquarter , and group by attribute headquarter by a bar chart. | SELECT Headquarter, SUM(Manufacturer) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter | nvbench |
CREATE TABLE table_30327 (
"Year Location" text,
"Mens Singles" text,
"Womens Singles" text,
"Mens Doubles" text,
"Womens Doubles" text
) | Name the womens doubles for werner schlager | SELECT "Womens Doubles" FROM table_30327 WHERE "Mens Singles" = 'Werner Schlager' | wikisql |
CREATE TABLE table_27722734_7 (
record VARCHAR,
game VARCHAR
) | Name the record for 23 game | SELECT record FROM table_27722734_7 WHERE game = 23 | sql_create_context |
CREATE TABLE table_30976 (
"Season no." real,
"Series no." real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" real,
"U.S. viewers (millions)" text
) | What are the episode numbers in season that were titled 'The Consoler'? | SELECT "Season no." FROM table_30976 WHERE "Title" = 'The Consoler' | wikisql |
CREATE TABLE table_2112220_6 (
top_10s INTEGER,
best_finish VARCHAR
) | Name the most top 10s for 2 best finish | SELECT MAX(top_10s) FROM table_2112220_6 WHERE best_finish = "2" | sql_create_context |
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 outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how much of a difference has patient 25814 in mcv second measured on the current hospital visit compared to the first value measured on the current hospital visit? | SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25814 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'mcv') ORDER BY labevents.charttime LIMI... | mimic_iii |
CREATE TABLE table_name_24 (
score VARCHAR,
year VARCHAR,
winners VARCHAR,
runners_up VARCHAR
) | What was Galatasaray score when when he won in 1990 and Trabzonspor was the runner-up? | SELECT score FROM table_name_24 WHERE winners = "galatasaray" AND runners_up = "trabzonspor" AND year = 1990 | sql_create_context |
CREATE TABLE cost (
row_id number,
subject_id number,
hadm_id number,
event_type text,
event_id number,
chargetime time,
cost number
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
charttime time,
valuenum number,
value... | how many days is it since patient 31854 has been admitted to icu? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', icustays.intime)) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND icustays.outtime IS NULL | mimic_iii |
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 labevents (
row_id number,
subject_id number,
hadm_id number,
itemid number,
chart... | had patient 28484 visited the er until 3 years ago? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 28484 AND admissions.admission_location = 'emergency room admit' AND DATETIME(admissions.admittime) <= DATETIME(CURRENT_TIME(), '-3 year') | mimic_iii |
CREATE TABLE table_54548 (
"Rank" real,
"Name" text,
"Nation" text,
"Points" real,
"Places" real
) | what is the points for rank 12? | SELECT SUM("Points") FROM table_54548 WHERE "Rank" = '12' | wikisql |
CREATE TABLE table_name_59 (
position VARCHAR,
date_of_birth__age_ VARCHAR,
player VARCHAR
) | What is Postition, when Date of Birth (Age) is Example, and when Player is Mark Spencer? | SELECT position FROM table_name_59 WHERE date_of_birth__age_ = "example" AND player = "mark spencer" | 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... | 看看医疗就诊25360144782与医疗就诊03301513966中有哪一些名称相同的药品?把这些药品的名称和金额以及对应的医疗就诊ID列出来 | SELECT SOC_SRT_DIRE_NM, AMOUNT, MED_CLINIC_ID FROM t_kc22 WHERE (MED_CLINIC_ID = '25360144782' OR MED_CLINIC_ID = '03301513966') AND SOC_SRT_DIRE_NM IN ((SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '25360144782') INTERSECT (SELECT SOC_SRT_DIRE_NM FROM t_kc22 WHERE MED_CLINIC_ID = '03301513966')) | css |
CREATE TABLE table_14709 (
"Name" text,
"Line" text,
"Location" text,
"Closed" text,
"Current Status" text
) | What is the line of Mangalore station? | SELECT "Line" FROM table_14709 WHERE "Name" = 'mangalore' | wikisql |
CREATE TABLE table_name_69 (
attendance INTEGER,
date VARCHAR,
home VARCHAR
) | What is the maximum number of people in attendance on 16 August 2008 when the home team was Deportes Savio? | SELECT MAX(attendance) FROM table_name_69 WHERE date = "16 august 2008" AND home = "deportes savio" | sql_create_context |
CREATE TABLE table_17869 (
"#" real,
"Episode" text,
"Writer" text,
"Director" text,
"Viewers(millions)" text,
"Original airdate" text
) | How many millions of viewers did watch Episode 5? | SELECT "Viewers(millions)" FROM table_17869 WHERE "Episode" = 'Episode 5' | wikisql |
CREATE TABLE table_name_6 (
round VARCHAR,
player VARCHAR
) | WHAT IS THE ROUND FOR ZACH BOYCHUK? | SELECT COUNT(round) FROM table_name_6 WHERE player = "zach boychuk" | sql_create_context |
CREATE TABLE table_203_720 (
id number,
"date" text,
"opponent#" text,
"rank#" text,
"site" text,
"result" text
) | how many wins did the 1987 syracuse football team have ? | SELECT COUNT(*) FROM table_203_720 WHERE "result" = 'w' | squall |
CREATE TABLE table_name_70 (
points INTEGER,
year VARCHAR
) | What are the highest points with 2012 as the year? | SELECT MAX(points) FROM table_name_70 WHERE year = "2012" | sql_create_context |
CREATE TABLE tip (
tip_id int,
business_id varchar,
text longtext,
user_id varchar,
likes int,
year int,
month varchar
)
CREATE TABLE business (
bid int,
business_id varchar,
name varchar,
full_address varchar,
city varchar,
latitude varchar,
longitude varchar,
... | What is the number of Dentists in ' Los Angeles ' ? | SELECT COUNT(DISTINCT (business.name)) FROM business, category WHERE business.city = 'Los Angeles' AND category.business_id = business.business_id AND category.category_name = 'Dentists' | yelp |
CREATE TABLE table_26193 (
"Year" real,
"Division" real,
"League" text,
"Regular Season" text,
"Playoffs" text,
"Open Cup" text
) | Name the most year for conference finals | SELECT MAX("Year") FROM table_26193 WHERE "Playoffs" = 'Conference Finals' | wikisql |
CREATE TABLE coach (
Coach_ID int,
Coach_name text,
Gender text,
Club_ID int,
Rank int
)
CREATE TABLE player_coach (
Player_ID int,
Coach_ID int,
Starting_year int
)
CREATE TABLE match_result (
Rank int,
Club_ID int,
Gold int,
Big_Silver int,
Small_Silver int,
B... | Visualize a bar chart that X-axis is the gender and compute the number of players in each gender as a Y-axis, and could you list y axis in ascending order? | SELECT Gender, COUNT(Gender) FROM player GROUP BY Gender ORDER BY COUNT(Gender) | nvbench |
CREATE TABLE table_914 (
"Club" text,
"Played" text,
"Won" text,
"Drawn" text,
"Lost" text,
"Points for" text,
"Points against" text,
"Tries for" text,
"Tries against" text,
"Try bonus" text,
"Losing bonus" text,
"Points" text
) | What's the tries against count of the team with 396 points against? | SELECT COUNT("Tries against") FROM table_914 WHERE "Points against" = '396' | wikisql |
CREATE TABLE table_name_60 (
venue VARCHAR,
date VARCHAR
) | What is the venue on October 13, 2007? | SELECT venue FROM table_name_60 WHERE date = "october 13, 2007" | sql_create_context |
CREATE TABLE table_58713 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text
) | What is Score, when Player is 'Brad Faxon'? | SELECT "Score" FROM table_58713 WHERE "Player" = 'brad faxon' | wikisql |
CREATE TABLE table_204_662 (
id number,
"week" number,
"date" text,
"opponent" text,
"result" text,
"attendance" number,
"bye" text
) | what was the difference in points in week ones match up ? | SELECT ABS("result" - "result") FROM table_204_662 WHERE "week" = 1 | squall |
CREATE TABLE table_name_83 (
opponent VARCHAR,
date VARCHAR
) | Which opponent has a Date of 16 february 2003? | SELECT opponent FROM table_name_83 WHERE date = "16 february 2003" | sql_create_context |
CREATE TABLE table_23065 (
"Draw" real,
"Artist" text,
"Original" text,
"English Meaning" text,
"Language" text,
"Authors" text
) | What is the highest draw represented? | SELECT MAX("Draw") FROM table_23065 | wikisql |
CREATE TABLE table_2574 (
"Sigma level" real,
"Sigma (with 1.5\u03c3 shift)" text,
"DPMO" text,
"Percent defective" text,
"Percentage yield" text,
"Short-term C pk" text,
"Long-term C pk" text
) | What is the sigma (with 1.5 shift) when there are 69% defective? | SELECT "Sigma (with 1.5\u03c3 shift)" FROM table_2574 WHERE "Percent defective" = '69%' | wikisql |
CREATE TABLE table_21926985_2 (
state_rank_by_revenue VARCHAR,
company_name VARCHAR
) | What is the rank for Murphy Oil? | SELECT state_rank_by_revenue FROM table_21926985_2 WHERE company_name = "Murphy Oil" | sql_create_context |
CREATE TABLE diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
... | tell me whether d10w was given to patient 26057 in this month? | SELECT COUNT(*) > 0 FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26057)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'd10w' AN... | mimic_iii |
CREATE TABLE table_69531 (
"Name" text,
"Team" text,
"Qual 1" text,
"Qual 2" real,
"Best" real
) | Graham rahal for n/h/l racing has a qual 2 greater than 59.384 and how much lowest best? | SELECT MIN("Best") FROM table_69531 WHERE "Team" = 'n/h/l racing' AND "Name" = 'graham rahal' AND "Qual 2" > '59.384' | wikisql |
CREATE TABLE Street_Markets (
Market_ID INTEGER,
Market_Details VARCHAR(255)
)
CREATE TABLE Ref_Attraction_Types (
Attraction_Type_Code CHAR(15),
Attraction_Type_Description VARCHAR(255)
)
CREATE TABLE Tourist_Attractions (
Tourist_Attraction_ID INTEGER,
Attraction_Type_Code CHAR(15),
Loca... | what is the average price range of hotels for each each star rating code? | SELECT star_rating_code, AVG(price_range) FROM Hotels GROUP BY star_rating_code | nvbench |
CREATE TABLE table_17109 (
"Player" text,
"Position" text,
"School" text,
"Hometown" text,
"College" text
) | Where is Shaq Thompson from? | SELECT "Hometown" FROM table_17109 WHERE "Player" = 'Shaq Thompson' | wikisql |
CREATE TABLE table_name_42 (
year INTEGER,
start VARCHAR
) | What is the average Year, when Start is '11'? | SELECT AVG(year) FROM table_name_42 WHERE start = 11 | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
... | for patient robert hyden, specify gender and language | SELECT demographic.gender, demographic.language FROM demographic WHERE demographic.name = "Robert Hyden" | mimicsql_data |
CREATE TABLE table_24913533_4 (
assists INTEGER,
player VARCHAR
) | What is the maximum number of assists for players named Anastasia Kostaki? | SELECT MAX(assists) FROM table_24913533_4 WHERE player = "Anastasia Kostaki" | sql_create_context |
CREATE TABLE Institution (
Institution_id text,
Institution text,
Location text,
Founded real,
Type text,
Enrollment int,
Team text,
Primary_Conference text,
building_id text
)
CREATE TABLE protein (
common_name text,
protein_name text,
divergence_from_human_lineage real... | Please give me a bar chart showing institution types, along with the total enrollment for each type, sort by the X from low to high. | SELECT Type, SUM(Enrollment) FROM Institution GROUP BY Type ORDER BY Type | nvbench |
CREATE TABLE aircraft (
aircraft_code varchar,
aircraft_description varchar,
manufacturer varchar,
basic_type varchar,
engines int,
propulsion varchar,
wide_body varchar,
wing_span int,
length int,
weight int,
capacity int,
pay_load int,
cruising_speed int,
range_... | give me the first flight from BOSTON to ATLANTA | 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'ATLANT... | atis |
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
CREATE TABLE cost (
costid number,
uniquepid text,
patienthealthsystemstayid number,
eventtype text,
eventid numb... | what is the top three most frequent output event until 2100? | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2100' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 | eicu |
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 prescriptions... | How is Phenylephrine administered? | SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "PHENYLEPHrine" | mimicsql_data |
CREATE TABLE table_34665 (
"Date" text,
"Track" text,
"Race" text,
"Purse Hi" text,
"Finish" text,
"Time" text,
"Last 1/4" real,
"Odds" text,
"Driver" text
) | What were the odds for the finish of 1/4h? | SELECT "Odds" FROM table_34665 WHERE "Finish" = '1/4h' | wikisql |
CREATE TABLE table_203_447 (
id number,
"constituency" number,
"region" text,
"name" text,
"party" text,
"last elected" number
) | which party did jaime quintana belong to ? | SELECT "party" FROM table_203_447 WHERE "name" = 'jaime quintana' | squall |
CREATE TABLE table_203_505 (
id number,
"number" number,
"event" text,
"type" text,
"matthew" text,
"mark" text,
"luke" text,
"john" text
) | what is the total number of events ? | SELECT COUNT("event") FROM table_203_505 | squall |
CREATE TABLE table_16654 (
"Season" text,
"Group A Winner" text,
"Group B Winner" text,
"Group C Winner" text,
"Group D Winner" text
) | What is the group a winner for vis pesaro? | SELECT "Group A Winner" FROM table_16654 WHERE "Group C Winner" = 'Vis Pesaro' | wikisql |
CREATE TABLE table_name_13 (
nation VARCHAR,
heat VARCHAR,
rank VARCHAR
) | Which nation has a heat of 4, and is ranked 8? | SELECT nation FROM table_name_13 WHERE heat = 4 AND rank = 8 | sql_create_context |
CREATE TABLE table_250309_1 (
company VARCHAR,
parent_company VARCHAR
) | what is the company with the parent company wrightbus? | SELECT company FROM table_250309_1 WHERE parent_company = "Wrightbus" | sql_create_context |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY varchar(30),
STATE_PROVINCE varchar(25... | For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the average of employee_id bin hire_date by time. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 | nvbench |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE course_prerequisite (
pre_course_id int,
course_id int
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credi... | Is it okay if I take 792 on Mondays and Wednesdays ? | SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour... | advising |
CREATE TABLE table_name_74 (
city VARCHAR,
team VARCHAR
) | where is the pegah team located? | SELECT city FROM table_name_74 WHERE team = "pegah" | 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,
... | how many patients whose year of birth is less than 1879 and item id is 51093? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "1879" AND lab.itemid = "51093" | mimicsql_data |
CREATE TABLE table_71110 (
"Year" real,
"Winner" text,
"Country" text,
"Score" real,
"To par" text,
"1st prize ( $ )" real
) | What is the total number of 1st prize ($) that has a United States country with a score lower than 271 and in a year after 1964 with a winner of Bobby Mitchell? | SELECT COUNT("1st prize ( $ )") FROM table_71110 WHERE "Country" = 'united states' AND "Score" < '271' AND "Year" > '1964' AND "Winner" = 'bobby mitchell' | wikisql |
CREATE TABLE table_name_12 (
date VARCHAR,
catalog VARCHAR
) | What was the date for XLLP 369? | SELECT date FROM table_name_12 WHERE catalog = "xllp 369" | sql_create_context |
CREATE TABLE table_20850527_1 (
game VARCHAR,
opponent VARCHAR
) | What game number did the Wildcats play Purdue? | SELECT game FROM table_20850527_1 WHERE opponent = "Purdue" | sql_create_context |
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
Text text,
ContentLicense text
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description... | Count of posts with only one tag, grouped by tag. | SELECT COUNT(p.Id), p.Tags FROM Posts AS p WHERE NOT p.Tags LIKE '%><%' GROUP BY p.Tags ORDER BY COUNT(p.Id) DESC | sede |
CREATE TABLE table_32474 (
"Name" text,
"Release date" text,
"RTM build" text,
"Current version" text,
"Status support" text,
"License" text,
"Based on (kernel)" text,
"Supported architectures" text,
"OS type" text
) | What is the current version of windows 8 with an RTM build of 9200? | SELECT "Current version" FROM table_32474 WHERE "RTM build" = '9200' AND "Name" = 'windows 8' | wikisql |
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,
wardi... | this year, what are the top three most frequent diagnoses that patients were diagnosed with in the same month after the diagnosis of brain hem nec-brief coma. | SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions... | mimic_iii |
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId number,
DeletionUserId number
)
CREATE TABLE PostFeedback (
Id number,
PostId number,
IsAnonymous boolean,
Vote... | Getting top 50 viewed posts. | SELECT * FROM Posts ORDER BY ViewCount DESC LIMIT 50 | sede |
CREATE TABLE table_204_850 (
id number,
"name" text,
"railway" text,
"series" text,
"maker" text,
"dates" text,
"drive" text,
"wheel arrangement" text,
"weight" text,
"power" text,
"notes" text
) | what is the difference in weight between the re 465 and the ae 6/6 ? | SELECT ABS((SELECT "weight" FROM table_204_850 WHERE "name" = 're 465') - (SELECT "weight" FROM table_204_850 WHERE "name" = 'ae 6/6')) | squall |
CREATE TABLE table_27980 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text,
"U.S. viewers (million)" text
) | How many million U.S. viewers watched the episode with a production code of 1arc03? | SELECT "U.S. viewers (million)" FROM table_27980 WHERE "Production code" = '1ARC03' | wikisql |
CREATE TABLE table_17881033_1 (
division_north VARCHAR,
division_south VARCHAR,
division_southwest VARCHAR
) | what is the division north when division south was ko uf and division southwest was ilinden velmej | SELECT division_north FROM table_17881033_1 WHERE division_south = "Kožuf" AND division_southwest = "Ilinden Velmej" | sql_create_context |
CREATE TABLE table_11336756_6 (
route_name VARCHAR,
remarks VARCHAR
) | Which routes have 'replaced by US 81' listed in their remarks section? | SELECT route_name FROM table_11336756_6 WHERE remarks = "Replaced by US 81" | sql_create_context |
CREATE TABLE table_52024 (
"Stadium" text,
"Capacity" real,
"City" text,
"Club" text,
"Opening" real
) | What is the lowest capacity with an opening larger than 2015 in Trabzon? | SELECT MIN("Capacity") FROM table_52024 WHERE "Opening" > '2015' AND "City" = 'trabzon' | wikisql |
CREATE TABLE table_33326 (
"Country" text,
"Area (km\u00b2) 2010" text,
"Population 2011" text,
"GDP (PPP) ( Intl. $ ) 2011" text,
"GDP (PPP) per capita ( Intl. $ ) 2011" text,
"Income inequality 1994\u20132011 (latest available)" text,
"HDI 2011" text,
"FSI 2012" text,
"CPI 2011" te... | What is the HDI 2011 of the country with a DI 2011 of 7.63? | SELECT "HDI 2011" FROM table_33326 WHERE "DI 2011" = '7.63' | wikisql |
CREATE TABLE table_45907 (
"Winner" text,
"Country" text,
"Winter Olympics" text,
"FIS Nordic World Ski Championships" text,
"Holmenkollen" text
) | Which Winner has a Country of norway, and a FIS Nordic World Ski Championships of 1924? | SELECT "Winner" FROM table_45907 WHERE "Country" = 'norway' AND "FIS Nordic World Ski Championships" = '1924' | wikisql |
CREATE TABLE table_38800 (
"Driver" text,
"Constructor" text,
"Laps" text,
"Time/Retired" text,
"Grid" text
) | What was the time of the car having a constructor of Renault, which went 40 laps? | SELECT "Time/Retired" FROM table_38800 WHERE "Constructor" = 'renault' AND "Laps" = '40' | 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 diagnoses_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE... | had a absolute lymphocyte count lab test patient 51675 received until 3 years ago? | SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'absolute lymphocyte count') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51675) AND DATETIME(labevents.charttime) <= DATETIME(CURRENT_TIME... | mimic_iii |
CREATE TABLE table_name_96 (
region VARCHAR,
location VARCHAR
) | what is the region when the location is 49.7462 n 117.1419 w? | SELECT region FROM table_name_96 WHERE location = "49.7462°n 117.1419°w" | sql_create_context |
CREATE TABLE table_name_12 (
total_viewers VARCHAR,
share INTEGER
) | When the shares were less than 8, how many total viewers were there? | SELECT total_viewers FROM table_name_12 WHERE share < 8 | sql_create_context |
CREATE TABLE jybgb_jyjgzbb (
JYZBLSH number,
YLJGDM text,
jyjgzbb_id number
)
CREATE TABLE person_info (
CSD text,
CSRQ time,
GJDM text,
GJMC text,
JGDM text,
JGMC text,
MZDM text,
MZMC text,
RYBH text,
XBDM number,
XBMC text,
XLDM text,
XLMC text,
XM... | 患者的检测指标673489的参考值范围下限和上限在门诊诊断为疾病S24.591中是什么? | SELECT jyjgzbb.CKZFWXX, jyjgzbb.CKZFWSX FROM mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN jybgb_jyjgzbb ON mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jybgb_jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH AND jybgb_jyjgzbb.JYZBLSH = jyjgzbb.JYZBLSH AND jybgb_jyjgzbb.jyjgzbb_id ... | css |
CREATE TABLE ReviewTaskStates (
Id number,
Name text,
Description text
)
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate... | Show all review task states. | SELECT * FROM ReviewTaskStates | sede |
CREATE TABLE table_15442974_1 (
fourth_district VARCHAR,
second_district VARCHAR
) | Name the fourth district for joan runnels | SELECT fourth_district FROM table_15442974_1 WHERE second_district = "Joan Runnels" | 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 demographic ... | how many patients stayed in hospital for more than 0 days and used the drug Morphine sulfate sr? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Morphine Sulfate SR" | mimicsql_data |
CREATE TABLE table_2850912_3 (
college_junior_club_team VARCHAR,
player VARCHAR
) | What is Robert Dirk's team? | SELECT college_junior_club_team FROM table_2850912_3 WHERE player = "Robert Dirk" | sql_create_context |
CREATE TABLE table_452 (
"Episode" text,
"Theme" text,
"Song choice" text,
"Original artist" text,
"Order #" text,
"Result" text
) | What theme placed as #3 in the finale? | SELECT "Result" FROM table_452 WHERE "Theme" = 'Finale' AND "Order #" = '3' | wikisql |
CREATE TABLE table_10481 (
"Date" text,
"Track" text,
"Race" text,
"Dist." text,
"Purse ( US$ )" text,
"Track Surf." text,
"Winning horse" text,
"Win jockey" text
) | What was the Illinois Derby purse? | SELECT "Purse ( US$ )" FROM table_10481 WHERE "Race" = 'illinois derby' | wikisql |
CREATE TABLE table_name_18 (
year_s__won VARCHAR,
country VARCHAR,
to_par VARCHAR,
total VARCHAR
) | Can you tell me the Year(s) Won that has the To par larger than 5, and the Total smaller than 155, and the Country of united states? | SELECT year_s__won FROM table_name_18 WHERE to_par > 5 AND total < 155 AND country = "united states" | sql_create_context |
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... | Who are the most knowledgable users for a given tag?. | SELECT U.Id AS "user_link", SUM(A.Score) AS ASum, AVG(A.Score) AS AAvg, VAR(A.Score) AS AVar FROM Posts AS Q JOIN PostTags AS PT ON PT.PostId = Q.Id JOIN Tags AS T ON T.Id = PT.TagId JOIN Posts AS A ON A.ParentId = Q.Id JOIN Users AS U ON U.Id = A.OwnerUserId WHERE T.TagName = '##Tag##' GROUP BY U.Id | sede |
CREATE TABLE table_10108 (
"Block A" text,
"Wataru Inoue" text,
"Jushin Liger" text,
"Minoru" text,
"Ryusuke Taguchi" text,
"Tatsuhito Takaiwa" text,
"Yujiro" text
) | Name the ryusuke taguchi for Jushin Liger of liger (9:57) | SELECT "Ryusuke Taguchi" FROM table_10108 WHERE "Jushin Liger" = 'liger (9:57)' | wikisql |
CREATE TABLE hz_info (
KH text,
KLX number,
YLJGDM text,
RYBH text
)
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,... | 在住院就诊83482640652中,入院途径名是什么?还有代码呢 | SELECT RYTJDM, RYTJMC FROM zyjzjlb WHERE JZLSH = '83482640652' | css |
CREATE TABLE table_2429 (
"Period" text,
"Births" text,
"Deaths" text,
"Difference" text,
"Crude Birth Rate" real,
"Crude Death Rate" real,
"Natural Increase" real,
"Total Fertility Rate" real,
"Infant Mortality Rate" real
) | where births is 388 000 how many number is natural increase | SELECT COUNT("Natural Increase") FROM table_2429 WHERE "Births" = '388 000' | wikisql |
CREATE TABLE PendingFlags (
Id number,
FlagTypeId number,
PostId number,
CreationDate time,
CloseReasonTypeId number,
CloseAsOffTopicReasonTypeId number,
DuplicateOfQuestionId number,
BelongsOnBaseHostAddress text
)
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId nu... | Get users that have contributed to a keyword.. | SELECT p.Title, p.Tags, p.CreationDate, p.AnswerCount, p.CommentCount, p.OwnerUserId, Users.DisplayName, Users.Reputation FROM Posts AS p JOIN Users ON Users.Id = p.OwnerUserId WHERE p.Tags LIKE '%qt%' ORDER BY p.CreationDate | sede |
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 employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL v... | For those employees who was hired before 2002-06-21, give me the comparison about the amount of job_id over the job_id , and group by attribute job_id, and order by the total number in ascending. | SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY COUNT(JOB_ID) | nvbench |
CREATE TABLE table_name_28 (
tie_no VARCHAR,
away_team VARCHAR
) | Which Tie no that has an Away team of altrincham? | SELECT tie_no FROM table_name_28 WHERE away_team = "altrincham" | sql_create_context |
CREATE TABLE table_48181 (
"Week" real,
"Date" text,
"Opponent" text,
"Result" text,
"Channel" text,
"Attendance" text
) | What is the total number of weeks that the Giants played against the Dallas Cowboys? | SELECT COUNT("Week") FROM table_48181 WHERE "Opponent" = 'dallas cowboys' | wikisql |
CREATE TABLE table_74670 (
"Country" text,
"Year (most recent)" real,
"Adult (15+) Literacy Rate Total" text,
"Adult Men" text,
"Adult Women" text,
"Youth (15-24) Literacy Rate Total" text,
"Youth Men" text,
"Youth Women" text
) | Which country has its most recent year as being 2005 and has an Adult Men literacy rate of 96%? | SELECT "Country" FROM table_74670 WHERE "Year (most recent)" = '2005' AND "Adult Men" = '96%' | wikisql |
CREATE TABLE table_name_50 (
score VARCHAR,
date VARCHAR
) | Which Score has a Date of 13 april 1997? | SELECT score FROM table_name_50 WHERE date = "13 april 1997" | sql_create_context |
CREATE TABLE table_38862 (
"Year" text,
"Theme" text,
"Host city" text,
"Venue" text,
"Hosts" text
) | Who are the hosts from the event with a theme of codehunters and the host city of Bangkok? | SELECT "Hosts" FROM table_38862 WHERE "Host city" = 'bangkok' AND "Theme" = 'codehunters' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.