context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_14058433_4 (
drawn VARCHAR,
lost VARCHAR
) | what's the drawn with lost being 4 | SELECT drawn FROM table_14058433_4 WHERE lost = "4" | sql_create_context |
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,
... | count the number of patients whose ethnicity is american indian/alaska native and drug name is prochlorperazine? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "AMERICAN INDIAN/ALASKA NATIVE" AND prescriptions.drug = "Prochlorperazine" | mimicsql_data |
CREATE TABLE table_name_14 (
pick INTEGER,
position VARCHAR,
round VARCHAR
) | What is the average Pick with a Position of pg, and a Round less than 1? | SELECT AVG(pick) FROM table_name_14 WHERE position = "pg" AND round < 1 | sql_create_context |
CREATE TABLE table_name_66 (
kickoff_ VARCHAR,
a_ VARCHAR,
record VARCHAR
) | When was the kickoff during a game with a record of 1-7? | SELECT kickoff_ AS "a_" FROM table_name_66 WHERE record = "1-7" | sql_create_context |
CREATE TABLE table_name_28 (
time VARCHAR,
name VARCHAR
) | What is the time for Adi Bichman? | SELECT time FROM table_name_28 WHERE name = "adi bichman" | sql_create_context |
CREATE TABLE table_78634 (
"Name" text,
"Wins" real,
"Start" text,
"Duration" text,
"Defeated by" text
) | What is the Duration for less than 53 consecutive wins? | SELECT "Duration" FROM table_78634 WHERE "Wins" < '53' | wikisql |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE patient (
uniquepid text,
patienthealthsystemstayid number,
patientunitstayid number,
gender text,
age text,
ethnicity text,
hospitalid num... | what was the name of the drug patient 005-73237 was prescribed with within 2 days after having received a mechanical ventilation - volume controlled procedure in a month before? | SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-73237') AND treatment.treatme... | eicu |
CREATE TABLE t_kc22 (
AMOUNT number,
CHA_ITEM_LEV number,
DATA_ID text,
DIRE_TYPE number,
DOSE_FORM text,
DOSE_UNIT text,
EACH_DOSAGE text,
EXP_OCC_DATE time,
FLX_MED_ORG_ID text,
FXBZ number,
HOSP_DOC_CD text,
HOSP_DOC_NM text,
MED_CLINIC_ID text,
MED_DIRE_CD tex... | 49170481089这次医疗就诊,查询个人自理的总金额 | SELECT t_kc24.PER_SOL FROM t_kc24 JOIN t_kc21_t_kc24 JOIN t_kc21 ON t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID AND t_kc21_t_kc24.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '49170481089' | css |
CREATE TABLE table_name_74 (
event VARCHAR
) | What is the 2007-08 result when the event was Colonial Square? | SELECT 2007 AS _08 FROM table_name_74 WHERE event = "colonial square" | sql_create_context |
CREATE TABLE table_name_20 (
grid VARCHAR,
driver VARCHAR
) | What is the grid when the driver was Michael Schumacher? | SELECT grid FROM table_name_20 WHERE driver = "michael schumacher" | sql_create_context |
CREATE TABLE table_name_14 (
date VARCHAR,
venue VARCHAR
) | WHICH Date has a Venue of lancaster park , christchurch? | SELECT date FROM table_name_14 WHERE venue = "lancaster park , christchurch" | sql_create_context |
CREATE TABLE table_12030612_3 (
season__number VARCHAR,
written_by VARCHAR
) | What season features writer Michael Poryes? | SELECT season__number FROM table_12030612_3 WHERE written_by = "Michael Poryes" | sql_create_context |
CREATE TABLE table_name_66 (
attendance INTEGER,
date VARCHAR
) | What attendance is dated february 27? | SELECT AVG(attendance) FROM table_name_66 WHERE date = "february 27" | sql_create_context |
CREATE TABLE table_255188_1 (
founded INTEGER,
nickname VARCHAR
) | When were the Avenging Angels founded? | SELECT MAX(founded) FROM table_255188_1 WHERE nickname = "Avenging Angels" | sql_create_context |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 医院9698019的非科室3455负责的所有医疗就诊记录有哪些在2001-11-15到2014-12-27内? | (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9698019' AND IN_HOSP_DATE BETWEEN '2001-11-15' AND '2014-12-27') EXCEPT (SELECT * FROM t_kc21 WHERE MED_SER_ORG_NO = '9698019' AND IN_HOSP_DATE BETWEEN '2001-11-15' AND '2014-12-27' AND MED_ORG_DEPT_CD = '3455') | css |
CREATE TABLE table_21144 (
"Country" text,
"Name" text,
"Network" text,
"Premiere" text,
"Host(s)" text,
"Judges" text,
"Seasons and Winners" text
) | Name the number of judges for dr steemans ann van elsen | SELECT COUNT("Judges") FROM table_21144 WHERE "Host(s)" = 'Dré Steemans Ann Van Elsen' | wikisql |
CREATE TABLE procedures_icd (
row_id number,
subject_id number,
hadm_id number,
icd9_code text,
charttime time
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE diagnoses_i... | the previous year patient 23475 went to the hospital? | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 23475 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') | mimic_iii |
CREATE TABLE aircraft (
Id VARCHAR
) | How many aircrafts are there? | SELECT COUNT(*) FROM aircraft | sql_create_context |
CREATE TABLE table_79480 (
"Frequency" text,
"Station" text,
"Operator" text,
"Language" text,
"Genre" text
) | What genre has a station of Class 95FM? | SELECT "Genre" FROM table_79480 WHERE "Station" = 'class 95fm' | wikisql |
CREATE TABLE table_name_31 (
english VARCHAR,
cardinal_direction VARCHAR
) | What is the cardinal direction northwest in English? | SELECT english FROM table_name_31 WHERE cardinal_direction = "northwest" | sql_create_context |
CREATE TABLE table_name_28 (
date VARCHAR,
competition VARCHAR,
opponents VARCHAR
) | What is Date, when Competition is 'F', and when Opponents is 'FC Astoria Walldorf'? | SELECT date FROM table_name_28 WHERE competition = "f" AND opponents = "fc astoria walldorf" | sql_create_context |
CREATE TABLE table_71017 (
"Date" text,
"Tournament" text,
"Surface" text,
"Tier" text,
"Opponent in the final" text,
"Score" text
) | What was the tier versus Manana Shapakidze? | SELECT "Tier" FROM table_71017 WHERE "Opponent in the final" = 'manana shapakidze' | wikisql |
CREATE TABLE table_dev_49 (
"id" int,
"gender" string,
"systolic_blood_pressure_sbp" int,
"renal_disease" bool,
"diastolic_blood_pressure_dbp" int,
"high_density_lipoprotein_cholesterol_hdl_c" int,
"serum_creatinine" float,
"waist_circumference" int,
"triglyceride_tg" float,
"hyp... | participants with impaired renal function ( serum creatinine > 124 micromole per liter ( umol / l ) [ 1.4 milligrams per deciliter ( mg / dl ) ] in female , > 133 umol / l [ 1.5 mg / dl] in male ) | SELECT * FROM table_dev_49 WHERE renal_disease = 1 OR ((serum_creatinine > 1.5 AND gender = 'male') OR (serum_creatinine > 1.4 AND gender = 'female')) | criteria2sql |
CREATE TABLE table_name_47 (
remixed_by VARCHAR,
version VARCHAR
) | What's the Remixed by with a Version of Strings for Soul's Mix? | SELECT remixed_by FROM table_name_47 WHERE version = "strings for soul's mix" | sql_create_context |
CREATE TABLE table_75768 (
"County" text,
"Population (2011)" real,
"Population (2006)" real,
"Change (%)" real,
"Area (km\u00b2)" real,
"Population density" real
) | What is the Population density that has a Change (%) higher than 10.4, and a Population (2011) less than 8574, in the County of Queens? | SELECT AVG("Population density") FROM table_75768 WHERE "Change (%)" > '10.4' AND "County" = 'queens' AND "Population (2011)" < '8574' | wikisql |
CREATE TABLE table_name_32 (
game VARCHAR,
location_attendance VARCHAR,
score VARCHAR
) | What game was played at Omni Coliseum with a w 105-95 score? | SELECT game FROM table_name_32 WHERE location_attendance = "omni coliseum" AND score = "w 105-95" | sql_create_context |
CREATE TABLE table_64708 (
"Group" text,
"Name" text,
"Nationality" text,
"4.00" text,
"Result" text
) | Anastasija Reiberger from Germany had what 4.00? | SELECT "4.00" FROM table_64708 WHERE "Nationality" = 'germany' AND "Name" = 'anastasija reiberger' | wikisql |
CREATE TABLE microlab (
microlabid number,
patientunitstayid number,
culturesite text,
organism text,
culturetakentime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE patient (
uniquepid text,
... | what is the top three most frequent laboratory tests ordered for patients during the same hospital encounter after the diagnosis of wound dehiscence / evisceration? | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'wound dehiscence ... | eicu |
CREATE TABLE Users (
Id number,
Reputation number,
CreationDate time,
DisplayName text,
LastAccessDate time,
WebsiteUrl text,
Location text,
AboutMe text,
Views number,
UpVotes number,
DownVotes number,
ProfileImageUrl text,
EmailHash text,
AccountId number
)
CRE... | Percent of users whose first post was a question of score > 0, out of all users who have posted. | WITH QA AS (SELECT *, ROW_NUMBER() OVER (PARTITION BY OwnerUserId ORDER BY OwnerUserId, CreationDate) AS PostOrder FROM Posts WHERE PostTypeId IN (1, 2) AND CommunityOwnedDate IS NULL AND DeletionDate IS NULL) SELECT ROUND(100.0 * num.NFirstGoodQ / denom.NPosters, 2) FROM (SELECT COUNT(Id) AS NPosters FROM Users WHERE ... | sede |
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... | 64550876病患想知道78857040071这次医疗就诊的检验报告详情 | SELECT * FROM jybgb WHERE JZLSH = '78857040071' | css |
CREATE TABLE PostHistoryTypes (
Id number,
Name text
)
CREATE TABLE Votes (
Id number,
PostId number,
VoteTypeId number,
UserId number,
CreationDate time,
BountyAmount number
)
CREATE TABLE PostNoticeTypes (
Id number,
ClassId number,
Name text,
Body text,
IsHidden ... | Count of suggested edits with a word in the revision comment. | SELECT * FROM SuggestedEdits AS s, SuggestedEditVotes AS v WHERE s.Comment LIKE '%##pattern##%' AND v.UserId = '##user##' AND s.Id = v.SuggestedEditId ORDER BY s.CreationDate /* ( SELECT 'All', COUNT(*) FROM SuggestedEdits s WHERE s.Comment LIKE '%##pattern##%' ) UNION ( SELECT 'Voted by me', COUNT(*) FROM SuggestedEdi... | sede |
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
) | For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and code , and group by attribute name. | SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name | nvbench |
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 restriction (
restriction_code text,
... | KANSAS CITY to LAS VEGAS economy | 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, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEGAS' AND fare_basis.economy = 'YES' AND fare.fare_ba... | atis |
CREATE TABLE table_204_318 (
id number,
"date" text,
"opponent" text,
"venue" text,
"result" text,
"attendance" number,
"scorers" text
) | what is the most we scored in a single game ? | SELECT MAX("result") FROM table_204_318 | squall |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE offering_instructor (
offering_instructor_id int,
offering_id int,
instructor_id int
)
CREATE TABLE program_requirement (
program_id int,
category varchar,
min_credit int,
additio... | Is 495 taught by anyone besides Prof. Eugene Cassidy ? | SELECT DISTINCT instructor.name FROM course, course_offering, instructor, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 495 AND NOT instructor.name LIKE '%Eugene Cassidy%' AND offering_instructor.instructor_id = instructor.instructor_id AND off... | advising |
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... | 病号21701297在2000年5月29日到2009年5月18日内期间所有检验结果指标记录中使用的仪器编号还有名称都叫什么 | SELECT jyjgzbb.YQBH, jyjgzbb.YQMC FROM hz_info JOIN txmzjzjlb JOIN jybgb JOIN jyjgzbb ON hz_info.YLJGDM = txmzjzjlb.YLJGDM AND hz_info.KH = txmzjzjlb.KH AND hz_info.KLX = txmzjzjlb.KLX AND txmzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND txmzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH ... | css |
CREATE TABLE table_63708 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | What was the location/attendance for the game with a record of 16-6? | SELECT "Location/Attendance" FROM table_63708 WHERE "Record" = '16-6' | wikisql |
CREATE TABLE club (
Club_ID int,
name text,
Region text,
Start_year text
)
CREATE TABLE competition_result (
Competition_ID int,
Club_ID_1 int,
Club_ID_2 int,
Score text
)
CREATE TABLE club_rank (
Rank real,
Club_ID int,
Gold real,
Silver real,
Bronze real,
Tota... | Show the proportion of different competition types. | SELECT Competition_type, COUNT(Competition_type) FROM competition GROUP BY Competition_type | nvbench |
CREATE TABLE table_49742 (
"Game" real,
"January" real,
"Opponent" text,
"Score" text,
"Record" text
) | What is the score of the game before January 22 with a 30-7-7 record? | SELECT "Score" FROM table_49742 WHERE "January" < '22' AND "Record" = '30-7-7' | wikisql |
CREATE TABLE prescriptions (
row_id number,
subject_id number,
hadm_id number,
startdate time,
enddate time,
drug text,
dose_val_rx text,
dose_unit_rx text,
route text
)
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
... | how many days have elapsed since the last time patient 12927 was diagnosed with atrial flutter on the current hospital encounter? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnoses_icd.charttime)) FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'atrial flutter') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WH... | mimic_iii |
CREATE TABLE jybgb (
YLJGDM text,
YLJGDM_MZJZJLB text,
YLJGDM_ZYJZJLB text,
BGDH text,
BGRQ time,
JYLX number,
JZLSH text,
JZLSH_MZJZJLB text,
JZLSH_ZYJZJLB text,
JZLX number,
KSBM text,
KSMC text,
SQRGH text,
SQRXM text,
BGRGH text,
BGRXM text,
SHRGH ... | 从02年1月12日起到04年5月29日时患者章淑华所有检验报告单的审核日期是什么时候? | (SELECT jybgb.SHSJ FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb 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 AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE person_info.XM = '章淑华' AND jyb... | css |
CREATE TABLE table_name_8 (
status VARCHAR,
name VARCHAR
) | Name the status for belletti | SELECT status FROM table_name_8 WHERE name = "belletti" | sql_create_context |
CREATE TABLE table_45535 (
"Season" real,
"Premiere" text,
"Finale" text,
"Rank" text,
"Rating" text
) | What is the rank for the episode that premiered on September 12, 1979? | SELECT "Rank" FROM table_45535 WHERE "Premiere" = 'september 12, 1979' | wikisql |
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.KSBM, jybgb.KSMC FROM hz_info JOIN mzjzjlb JOIN jybgb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jybgb.YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jybgb.JZLSH_MZJZJLB WHERE hz_info.person_info_XM = '吕莉莉' AND jybgb.BGRQ BETWEEN '2003-12-02' AND '... | css |
CREATE TABLE table_name_12 (
genre VARCHAR,
game VARCHAR
) | Which Genre has a Game of tony hawk's pro skater 2? | SELECT genre FROM table_name_12 WHERE game = "tony hawk's pro skater 2" | sql_create_context |
CREATE TABLE table_69262 (
"Rank" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What nation won the fewest gold medals while being in Rank 1, with a total of 37 medals and more than 7 bronze medals? | SELECT MIN("Gold") FROM table_69262 WHERE "Total" = '37' AND "Rank" = '1' AND "Bronze" > '7' | wikisql |
CREATE TABLE table_name_94 (
score VARCHAR,
attendance VARCHAR
) | Can you tell me the Score that has the Attendance of 4,567? | SELECT score FROM table_name_94 WHERE attendance = "4,567" | sql_create_context |
CREATE TABLE table_4788 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the crowd numbers when the VFL played Victoria Park? | SELECT SUM("Crowd") FROM table_4788 WHERE "Venue" = 'victoria park' | wikisql |
CREATE TABLE table_name_3 (
year VARCHAR,
points VARCHAR
) | What year were there 29 (32) points? | SELECT year FROM table_name_3 WHERE points = "29 (32)" | sql_create_context |
CREATE TABLE Claims_Processing_Stages (
Claim_Stage_ID INTEGER,
Next_Claim_Stage_ID INTEGER,
Claim_Status_Name VARCHAR(255),
Claim_Status_Description VARCHAR(255)
)
CREATE TABLE Claims_Documents (
Claim_ID INTEGER,
Document_Type_Code CHAR(15),
Created_by_Staff_ID INTEGER,
Created_Date I... | For each policy type, return its type code and its count in the record. Visualize by bar chart. | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code | nvbench |
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, draw a scatter chart about the correlation between salary and commission_pct . | SELECT SALARY, COMMISSION_PCT FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_73997 (
"District" text,
"Incumbent" text,
"Party" text,
"First elected" text,
"Result" text,
"Candidates" text
) | Name the total number of party for willis alston | SELECT COUNT("Party") FROM table_73997 WHERE "Incumbent" = 'Willis Alston' | wikisql |
CREATE TABLE table_name_14 (
manner_of_departure VARCHAR,
date_of_vacancy VARCHAR
) | what is the manner of departure when the date of vacancy is 15 september 2008? | SELECT manner_of_departure FROM table_name_14 WHERE date_of_vacancy = "15 september 2008" | sql_create_context |
CREATE TABLE company (
company_id number,
rank number,
company text,
headquarters text,
main_industry text,
sales_billion number,
profits_billion number,
assets_billion number,
market_value number
)
CREATE TABLE station_company (
station_id number,
company_id number,
ran... | What are the headquarters that have both a company in the banking and 'oil and gas' industries? | SELECT headquarters FROM company WHERE main_industry = 'Banking' INTERSECT SELECT headquarters FROM company WHERE main_industry = 'Oil and gas' | spider |
CREATE TABLE departments (
DEPARTMENT_ID decimal(4,0),
DEPARTMENT_NAME varchar(30),
MANAGER_ID decimal(6,0),
LOCATION_ID decimal(4,0)
)
CREATE TABLE jobs (
JOB_ID varchar(10),
JOB_TITLE varchar(35),
MIN_SALARY decimal(6,0),
MAX_SALARY decimal(6,0)
)
CREATE TABLE job_history (
EMPLO... | For those employees who did not have any job in the past, visualize a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) | nvbench |
CREATE TABLE table_57714 (
"Class" text,
"Type" text,
"Quantity" real,
"Date" text,
"LNER Class" text
) | What LNER Class has a Class of 3? | SELECT "LNER Class" FROM table_57714 WHERE "Class" = '3' | wikisql |
CREATE TABLE table_34416 (
"Country" text,
"Project Name" text,
"Year startup" text,
"Operator" text,
"Peak" text
) | What country has peak 20 and a project named jarn yabhour; ramhan? | SELECT "Country" FROM table_34416 WHERE "Peak" = '20' AND "Project Name" = 'jarn yabhour; ramhan' | wikisql |
CREATE TABLE table_68481 (
"Episode" text,
"First aired" text,
"Entrepreneur(s)" text,
"Company or product name" text,
"Money requested (\u00a3)" text,
"Investing Dragon(s)" text
) | What episode featured entrepreneur Richard Ernest? | SELECT "First aired" FROM table_68481 WHERE "Entrepreneur(s)" = 'richard ernest' | wikisql |
CREATE TABLE table_65521 (
"Rank" text,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the fewest number of bronze medals won among the nations ranked 12 that won no gold medals and 1 medal overall? | SELECT MIN("Bronze") FROM table_65521 WHERE "Total" = '1' AND "Rank" = '12' AND "Gold" < '1' | wikisql |
CREATE TABLE table_11985 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What was the home score at Lake Oval? | SELECT "Home team score" FROM table_11985 WHERE "Venue" = 'lake oval' | wikisql |
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
... | count the number of patients whose marital status is divorced and procedure short title is oth periton adhesiolysis? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "DIVORCED" AND procedures.short_title = "Oth periton adhesiolysis" | mimicsql_data |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
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... | 参照不同的科室编号与入院疾病的编码找出医院9424563所有就诊的记录里面医保大病支付的值比上总的医疗费用比值最小的是多少 | SELECT t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DIS_CD, MIN(t_kc24.ILL_PAY) FROM t_kc21 JOIN t_kc24 JOIN t_kc21_t_kc24 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc24.MED_CLINIC_ID AND t_kc21_t_kc24.MED_SAFE_PAY_ID = t_kc24.MED_SAFE_PAY_ID WHERE t_kc21.MED_SER_ORG_NO = '9424563' GROUP BY t_kc21.MED_ORG_DEPT_CD, t_kc21.IN_DIAG_DI... | css |
CREATE TABLE table_11240028_1 (
duration VARCHAR,
portrayed_by VARCHAR
) | What was the duration of Robert Joy's portrayal? | SELECT COUNT(duration) FROM table_11240028_1 WHERE portrayed_by = "Robert Joy" | sql_create_context |
CREATE TABLE table_1547 (
"Barangay" text,
"Area (km\u00b2)" text,
"Population (2007)" real,
"Population (2010)" real,
"Pop. density (per km\u00b2)" text
) | Name the least population 2007 for barangay is poblacion ii | SELECT MIN("Population (2007)") FROM table_1547 WHERE "Barangay" = 'Poblacion II' | wikisql |
CREATE TABLE table_name_98 (
record VARCHAR,
opponent VARCHAR
) | What was the record after the game against the Houston Oilers? | SELECT record FROM table_name_98 WHERE opponent = "houston oilers" | sql_create_context |
CREATE TABLE table_name_96 (
team VARCHAR,
year VARCHAR,
class VARCHAR
) | Which Team has a Year smaller than 2007, and a Class of gts? | SELECT team FROM table_name_96 WHERE year < 2007 AND class = "gts" | sql_create_context |
CREATE TABLE ref_colors (
Id VARCHAR
) | How many colors are there? | SELECT COUNT(*) FROM ref_colors | sql_create_context |
CREATE TABLE table_43157 (
"Week" real,
"Date" text,
"Time ( PT )" text,
"Opponent" text,
"Result" text,
"Record" text,
"Game site" text
) | What date has 10 for the week? | SELECT "Date" FROM table_43157 WHERE "Week" = '10' | wikisql |
CREATE TABLE table_21680 (
"Date" text,
"Opponent" text,
"Home / Away" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location/Attendance" text,
"Record" text
) | Name the high rebounds for march 15 | SELECT "High rebounds" FROM table_21680 WHERE "Date" = 'March 15' | wikisql |
CREATE TABLE table_26676 (
"Date (YYYY-MM-DD)" text,
"Time (UTC)" text,
"Latitude" text,
"Longitude" text,
"Depth" text,
"Magnitude" text
) | When 42.903 n is the latitude how many measurements of longitude are there? | SELECT COUNT("Longitude") FROM table_26676 WHERE "Latitude" = '42.903° N' | wikisql |
CREATE TABLE table_name_44 (
network VARCHAR,
region_country VARCHAR,
dates_aired VARCHAR
) | What is the name of the network in the United Kingdom which aired in 1985 1992? | SELECT network FROM table_name_44 WHERE region_country = "united kingdom" AND dates_aired = "1985–1992" | sql_create_context |
CREATE TABLE table_53077 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Venue" text,
"Crowd" real,
"Date" text
) | What team was the home team when the home team score was 26.14 (170)? | SELECT "Home team" FROM table_53077 WHERE "Home team score" = '26.14 (170)' | wikisql |
CREATE TABLE acceptance (
submission_id number,
workshop_id number,
result text
)
CREATE TABLE workshop (
workshop_id number,
date text,
venue text,
name text
)
CREATE TABLE submission (
submission_id number,
scores number,
author text,
college text
) | Which authors did not submit to any workshop? | SELECT author FROM submission WHERE NOT submission_id IN (SELECT submission_id FROM acceptance) | spider |
CREATE TABLE table_train_23 (
"id" int,
"in_another_study" bool,
"immune_suppression" bool,
"hiv_infection" bool,
"fio2" float,
"head_injury" bool,
"heart_disease" bool,
"steroid_therapy" bool,
"chemotherapy" bool,
"edema" bool,
"NOUSE" float
) | enrolment in another interventional study | SELECT * FROM table_train_23 WHERE in_another_study = 1 | criteria2sql |
CREATE TABLE table_62955 (
"Draw" real,
"Artist" text,
"Song" text,
"Percentage" text,
"Place" real
) | What Song has a Draw of less than 4 with a Percentage of 32.22%? | SELECT "Song" FROM table_62955 WHERE "Draw" < '4' AND "Percentage" = '32.22%' | wikisql |
CREATE TABLE table_11524 (
"Team" text,
"Home city" text,
"Stadium" text,
"Capacity" real,
"2011-12 season" text
) | What team finished 19th in serie a in 2011/2012? | SELECT "Team" FROM table_11524 WHERE "2011-12 season" = '19th in serie a' | wikisql |
CREATE TABLE t_kc21 (
MED_CLINIC_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
COMP_ID text,
PERSON_ID text,
PERSON_NM text,
IDENTITY_CARD text,
SOC_SRT_CARD text,
PERSON_SEX number,
PERSON_AGE number,
IN_HOSP_DATE time,
OUT_HOSP_DATE time,
DIFF_PLACE_FLG numb... | 统计医疗就诊10153173583这位患者相对应的住院或门诊流水号是多少? | SELECT CLINIC_ID FROM t_kc24 WHERE MED_CLINIC_ID = '10153173583' | css |
CREATE TABLE table_name_44 (
catalog VARCHAR,
date VARCHAR
) | Which catalog has a date of 24 march 2006? | SELECT catalog FROM table_name_44 WHERE date = "24 march 2006" | sql_create_context |
CREATE TABLE table_name_31 (
first_day_cover_cancellation VARCHAR,
design VARCHAR
) | What is the first day cover cancellation for the Karen Smith Design stamp? | SELECT first_day_cover_cancellation FROM table_name_31 WHERE design = "karen smith design" | sql_create_context |
CREATE TABLE table_name_95 (
wins INTEGER,
class VARCHAR,
year VARCHAR
) | Class of 125cc, and a Year smaller than 1966 had what lowest wins? | SELECT MIN(wins) FROM table_name_95 WHERE class = "125cc" AND year < 1966 | sql_create_context |
CREATE TABLE files (
f_id number(10),
artist_name varchar2(50),
file_size varchar2(20),
duration varchar2(20),
formats varchar2(20)
)
CREATE TABLE genre (
g_name varchar2(20),
rating varchar2(10),
most_popular_in varchar2(50)
)
CREATE TABLE song (
song_name varchar2(50),
artist... | how many songs were released for each format?, show from high to low by the x axis. | SELECT formats, COUNT(*) FROM files GROUP BY formats ORDER BY formats DESC | nvbench |
CREATE TABLE table_name_79 (
fa_cup INTEGER,
name VARCHAR,
total VARCHAR
) | What is the average number of FA cups Steve Whitworth, who has less than 400 total, has? | SELECT AVG(fa_cup) FROM table_name_79 WHERE name = "steve whitworth" AND total < 400 | sql_create_context |
CREATE TABLE table_27922491_8 (
player VARCHAR,
wickets VARCHAR
) | How many players had 12 wickets? | SELECT COUNT(player) FROM table_27922491_8 WHERE wickets = 12 | sql_create_context |
CREATE TABLE table_name_61 (
league_apps VARCHAR,
fa_cup_apps VARCHAR,
flt_apps VARCHAR
) | How many leage apperances for the player with one FA cup, and a FLT Apps of 0 (1)? | SELECT league_apps FROM table_name_61 WHERE fa_cup_apps = "1" AND flt_apps = "0 (1)" | sql_create_context |
CREATE TABLE table_203_252 (
id number,
"draw" number,
"country" text,
"language" text,
"artist" text,
"song" text,
"english translation" text,
"place" number,
"points" number
) | what song got the same points as straatdeuntje ? | SELECT "song" FROM table_203_252 WHERE "song" <> '"straatdeuntje"' AND "points" = (SELECT "points" FROM table_203_252 WHERE "song" = '"straatdeuntje"') | squall |
CREATE TABLE table_80039 (
"Episode" text,
"First aired" text,
"Entrepreneur(s)" text,
"Company or product name" text,
"Money requested (\u00a3)" real,
"Investing Dragon(s)" text
) | Who were the Investing Dragons in the episode that first aired on 18 January 2005 with the entrepreneur Tracey Herrtage? | SELECT "Investing Dragon(s)" FROM table_80039 WHERE "First aired" = '18 january 2005' AND "Entrepreneur(s)" = 'tracey herrtage' | wikisql |
CREATE TABLE table_name_87 (
quantity INTEGER,
year_s__of_manufacture VARCHAR,
seats VARCHAR
) | What is the average quantity for coaches manufactured in 1921/23, and had 40 seats? | SELECT AVG(quantity) FROM table_name_87 WHERE year_s__of_manufacture = "1921/23" AND seats = "40" | sql_create_context |
CREATE TABLE SuggestedEdits (
Id number,
PostId number,
CreationDate time,
ApprovalDate time,
RejectionDate time,
OwnerUserId number,
Comment text,
Text text,
Title text,
Tags text,
RevisionGUID other
)
CREATE TABLE VoteTypes (
Id number,
Name text
)
CREATE TABLE Po... | Changes in technologies in UK. | SELECT DATE(CreationDate) AS "date", COUNT(*) FROM Posts WHERE PostTypeId = 1 AND (Tags LIKE '%<java>%' AND Tags LIKE '%<.net>%' AND Tags LIKE '%<node.js>%' AND Tags LIKE '%<php>%' AND Tags LIKE '%<python>%' AND Tags LIKE '%<ruby>%' AND Tags LIKE '%<wordpress>%') GROUP BY DATE(CreationDate) ORDER BY DATE(CreationDate) | sede |
CREATE TABLE table_name_46 (
place VARCHAR,
to_par VARCHAR
) | What place has a to par of E? | SELECT place FROM table_name_46 WHERE to_par = "e" | sql_create_context |
CREATE TABLE table_47876 (
"Game" real,
"Date" text,
"Team" text,
"Score" text,
"High points" text,
"High rebounds" text,
"High assists" text,
"Location Attendance" text,
"Series" text
) | What team played at the Boston Garden when the series was 1-0? | SELECT "Team" FROM table_47876 WHERE "Location Attendance" = 'boston garden' AND "Series" = '1-0' | wikisql |
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,... | i would like to book a flight from BALTIMORE to SAN FRANCISCO before 1200 o'clock on tuesday | 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 ((date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE flight_stop (
flight_id int,
stop_number int,
stop_days text,
stop_airport text,
arrival_time int,
arrival_airline text,
arrival_flight_number int,
departure_time int,
departure_airline text,
departure_flight_number int,
stop_time int
)
CREATE TABLE month (
... | what flights are there from NASHVILLE to HOUSTON tomorrow evening that serve DINNER | 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, food_service WHERE (((((flight.departure_time <= 2000 AND flight.departure_time >= 2400) AND date_day.day_number = 20 AND date_day.month_number = 1 AN... | atis |
CREATE TABLE table_name_91 (
away_team VARCHAR,
home_team VARCHAR
) | What was the away score when North Melbourne was played? | SELECT away_team AS score FROM table_name_91 WHERE home_team = "north melbourne" | sql_create_context |
CREATE TABLE table_name_16 (
opponent VARCHAR,
score VARCHAR
) | When the Score was 6-2, which Opponent was played? | SELECT opponent FROM table_name_16 WHERE score = "6-2" | sql_create_context |
CREATE TABLE table_name_21 (
appearances INTEGER,
flamengo_career VARCHAR
) | How many appearances did the flamengo player who was with flamengo during the years 1989 1993 1996 1998 2004 2005 have? | SELECT MAX(appearances) FROM table_name_21 WHERE flamengo_career = "1989–1993 1996–1998 2004–2005" | sql_create_context |
CREATE TABLE has_allergy (
stuid number,
allergy text
)
CREATE TABLE student (
stuid number,
lname text,
fname text,
age number,
sex text,
major number,
advisor number,
city_code text
)
CREATE TABLE allergy_type (
allergy text,
allergytype text
) | Show first name and last name for all students. | SELECT fname, lname FROM student | spider |
CREATE TABLE zyjzjlb (
CYBQDM text,
CYBQMC text,
CYCWH text,
CYKSDM text,
CYKSMC text,
CYSJ time,
CYZTDM number,
HZXM text,
JZKSDM text,
JZKSMC text,
JZLSH text,
KH text,
KLX number,
MZBMLX number,
MZJZLSH text,
MZZDBM text,
MZZDMC text,
MZZYZDZZBM... | 患者79841221被门诊诊断为疾病Q06.940,他的检测指标673380的结果定量及单位是怎样的 | SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 jybgb.YLJGDM... | css |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE CloseReasonTypes (
Id number,
Name text,
Description text
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
Par... | Users Question and Answer Count Inline SELECT. | SELECT u.Id, (SELECT COUNT(*) FROM Posts AS q WHERE PostTypeId = 1 AND u.Id = q.OwnerUserId) AS QuestionCount, (SELECT COUNT(*) FROM Posts AS a WHERE PostTypeId = 2 AND u.Id = a.OwnerUserId) AS AnswerCount FROM Users AS u LIMIT 1000 | sede |
CREATE TABLE table_203_701 (
id number,
"#" number,
"title" text,
"featured guest(s)" text,
"producer(s)" text,
"length" text
) | what is the title to the last song ? | SELECT "title" FROM table_203_701 ORDER BY "#" DESC LIMIT 1 | squall |
CREATE TABLE table_28024 (
"Episode #" text,
"Original Air Date (UK)" text,
"Episode Title" text,
"Director" text,
"Writer" text,
"Cast" text
) | What is the original air date of episode 3-02? | SELECT "Original Air Date (UK)" FROM table_28024 WHERE "Episode #" = '3-02' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.