context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE prescriptions (
subject_id text,
hadm_id... | give me the number of patients whose admission location is phys referral/normal deli and year of death is less than or equal to 2148? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.dod_year <= "2148.0" | mimicsql_data |
CREATE TABLE table_name_76 (
home_team VARCHAR,
away_team VARCHAR
) | Who was the home team when Fitzroy was the away team? | SELECT home_team FROM table_name_76 WHERE away_team = "fitzroy" | sql_create_context |
CREATE TABLE table_name_84 (
points INTEGER,
games_played INTEGER
) | How many points on average are there for less than 5 games played? | SELECT AVG(points) FROM table_name_84 WHERE games_played < 5 | sql_create_context |
CREATE TABLE table_name_76 (
avg VARCHAR,
player VARCHAR
) | What is Domenik Hixon's average rush? | SELECT avg FROM table_name_76 WHERE player = "domenik hixon" | sql_create_context |
CREATE TABLE table_203_135 (
id number,
"institution" text,
"location" text,
"founded" number,
"type" text,
"enrollment" number,
"joined" number,
"nickname" text
) | how many institutions were founded before 1950 ? | SELECT COUNT("institution") FROM table_203_135 WHERE "founded" < 1950 | squall |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 医生负责医疗就诊12315818260出院诊断的编号及名称都是什么? | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE MED_CLINIC_ID = '12315818260' | css |
CREATE TABLE table_28715942_2 (
original_artist VARCHAR,
track VARCHAR
) | Who were the original artist(s) on harder to breathe? | SELECT original_artist FROM table_28715942_2 WHERE track = "Harder To Breathe" | sql_create_context |
CREATE TABLE table_name_41 (
attendance VARCHAR,
week VARCHAR
) | What was the attendance on week 1? | SELECT attendance FROM table_name_41 WHERE week = 1 | sql_create_context |
CREATE TABLE person (
name text,
age number,
city text,
gender text,
job text
)
CREATE TABLE personfriend (
name text,
friend text,
year number
) | How many different cities are they from? | SELECT COUNT(DISTINCT city) FROM person | spider |
CREATE TABLE table_name_96 (
rank VARCHAR,
country VARCHAR,
accolade VARCHAR
) | Which rank's country is the US when the accolade is 40 best albums of the year? | SELECT rank FROM table_name_96 WHERE country = "us" AND accolade = "40 best albums of the year" | 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 lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,... | calculate the number of unmarried patients who had a lab test for oxygen saturation. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Oxygen Saturation" | mimicsql_data |
CREATE TABLE Rooms (
roomName VARCHAR,
RoomId VARCHAR
)
CREATE TABLE Reservations (
Rate VARCHAR,
CheckIn VARCHAR,
CheckOut VARCHAR,
Room VARCHAR
) | Which room has the highest rate? List the room's full name, rate, check in and check out date. | SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1 | sql_create_context |
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,
... | tell me the number of patients on base drug prescription who have procedure icd9 code 5771. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "BASE" | mimicsql_data |
CREATE TABLE Department_Stores (
dept_store_id INTEGER,
dept_store_chain_id INTEGER,
store_name VARCHAR(80),
store_address VARCHAR(255),
store_phone VARCHAR(80),
store_email VARCHAR(80)
)
CREATE TABLE Department_Store_Chain (
dept_store_chain_id INTEGER,
dept_store_chain_name VARCHAR(80... | Return the average price for each product type Visualize by bar chart, I want to sort in desc by the Y. | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC | nvbench |
CREATE TABLE table_202_197 (
id number,
"year" number,
"round" number,
"gp" number,
"w" number,
"d" number,
"l" number,
"gf" number,
"ga" number
) | what was the largest gf in team history in the arab nations cup ? | SELECT MAX("gf") FROM table_202_197 | squall |
CREATE TABLE table_204_742 (
id number,
"release date" text,
"single title" text,
"uk singles chart\nposition" number,
"french\ncharts" number,
"german\ncharts" number,
"irish\ncharts" number,
"various" text
) | sister mary or run to me ? | SELECT "single title" FROM table_204_742 WHERE "single title" IN ('"sister mary" (duet with joe dolan)', '"run to me"') ORDER BY "release date" LIMIT 1 | squall |
CREATE TABLE table_1028356_3 (
year VARCHAR,
championship VARCHAR
) | What year was the championship in Wimbledon (2)? | SELECT year FROM table_1028356_3 WHERE championship = "Wimbledon (2)" | sql_create_context |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE transfers (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
eventtype text,
careunit text,... | until 3 years ago how many patients have had a blood culture ( myco/f lytic bottle) test performed? | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture ( myco/f lytic bottle)' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year')) | mimic_iii |
CREATE TABLE table_23924 (
"Name" text,
"#" real,
"Height" text,
"Weight" real,
"Position" text,
"Year" text,
"Home Town" text,
"High School" text
) | What is the home town of David Noel? | SELECT "Home Town" FROM table_23924 WHERE "Name" = 'David Noel' | wikisql |
CREATE TABLE table_name_72 (
director VARCHAR,
notes VARCHAR
) | Who had notes of Prizzi's Honor? | SELECT director FROM table_name_72 WHERE notes = "prizzi's honor" | sql_create_context |
CREATE TABLE employees (
EMPLOYEE_ID decimal(6,0),
FIRST_NAME varchar(20),
LAST_NAME varchar(25),
EMAIL varchar(25),
PHONE_NUMBER varchar(20),
HIRE_DATE date,
JOB_ID varchar(10),
SALARY decimal(8,2),
COMMISSION_PCT decimal(2,2),
MANAGER_ID decimal(6,0),
DEPARTMENT_ID decimal(... | For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id , and order by the bars in ascending. | SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER | nvbench |
CREATE TABLE table_78478 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | Name the score for 7 may 2000 | SELECT "Score" FROM table_78478 WHERE "Date" = '7 may 2000' | wikisql |
CREATE TABLE table_56600 (
"Season" text,
"Club" text,
"League" text,
"Apps." real,
"Goals" real
) | Which Major League Soccer team for the 2005 season has the lowest goals? | SELECT MIN("Goals") FROM table_56600 WHERE "League" = 'major league soccer' AND "Season" = '2005' | wikisql |
CREATE TABLE table_21577 (
"County" text,
"Kerry%" text,
"Kerry#" real,
"Bush%" text,
"Bush#" real,
"Others%" text,
"Others#" real
) | Name the minimum kerry # for bush % for 50.9% | SELECT MIN("Kerry#") FROM table_21577 WHERE "Bush%" = '50.9%' | wikisql |
CREATE TABLE table_53764 (
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What is the lowest total when the Bronze metals are larger than 0 and the nation is France (fra)? | SELECT MIN("Total") FROM table_53764 WHERE "Bronze" > '0' AND "Nation" = 'france (fra)' | wikisql |
CREATE TABLE table_2194 (
"Episode" text,
"First broadcast" text,
"Rufus guest" text,
"Marcus guest" text,
"Winner" text
) | When is the first broadcast for episodes where Rufus's guest is Jack Whitehall? | SELECT "First broadcast" FROM table_2194 WHERE "Rufus guest" = 'Jack Whitehall' | wikisql |
CREATE TABLE table_52266 (
"model" text,
"cylinders/ valves" text,
"displacement cc" real,
"max. power kW (PS) at rpm" text,
"max. torque (Nm) at rpm" text,
"engine code" text,
"top speed (km/h)" real,
"production period" text
) | What is the max torque of model 1.4 16v? | SELECT "max. torque (Nm) at rpm" FROM table_52266 WHERE "model" = '1.4 16v' | wikisql |
CREATE TABLE t_kc21_t_kc24 (
MED_CLINIC_ID text,
MED_SAFE_PAY_ID number
)
CREATE TABLE t_kc24 (
ACCOUNT_DASH_DATE time,
ACCOUNT_DASH_FLG number,
CASH_PAY number,
CIVIL_SUBSIDY number,
CKC102 number,
CLINIC_ID text,
CLINIC_SLT_DATE time,
COMP_ID text,
COM_ACC_PAY number,
... | 请分别列出医疗就诊09954947689与医疗费总费用相同的医疗就诊记录的ID、人员ID、人员姓名、人员性别、公民身份号码、人员年龄分别是什么呢? | SELECT t_kc21.MED_CLINIC_ID, t_kc21.PERSON_ID, t_kc21.PERSON_NM, t_kc21.IDENTITY_CARD, t_kc21.PERSON_SEX, t_kc21.PERSON_AGE 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_kc24.MED_AMOUT = (SELECT t_kc24.... | css |
CREATE TABLE instructor (
instructor_id int,
name varchar,
uniqname varchar
)
CREATE TABLE student_record (
student_id int,
course_id int,
semester int,
grade varchar,
how varchar,
transfer_source varchar,
earn_credit varchar,
repeat_term varchar,
test_id varchar
)
CREA... | Am I able to take 452 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 Customers_Cards (
card_id INTEGER,
customer_id INTEGER,
card_type_code VARCHAR(15),
card_number VARCHAR(80),
date_valid_from DATETIME,
date_valid_to DATETIME,
other_card_details VARCHAR(255)
)
CREATE TABLE Accounts (
account_id INTEGER,
customer_id INTEGER,
account_... | Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please. | SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE employee (
emp_num number,
emp_lname text,
emp_fname text,
emp_initial text,
emp_jobcode text,
emp_hiredate time,
emp_dob time
)
CREATE TABLE course (
crs_code text,
dept_code text,
crs_description text,
crs_credit number
)
CREATE TABLE department (
dept_co... | What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach? | SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name 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 JOIN department AS T5 ON T4.dept_code = T5.dept_code | spider |
CREATE TABLE table_1354805_6 (
competition_finish INTEGER,
average VARCHAR
) | what is the highest number where people got done at 31.1 | SELECT MAX(competition_finish) FROM table_1354805_6 WHERE average = "31.1" | sql_create_context |
CREATE TABLE PostLinks (
Id number,
CreationDate time,
PostId number,
RelatedPostId number,
LinkTypeId number
)
CREATE TABLE PostsWithDeleted (
Id number,
PostTypeId number,
AcceptedAnswerId number,
ParentId number,
CreationDate time,
DeletionDate time,
Score number,
... | How many of my answers were accepted on different days. | SELECT Votes.CreationDate, COUNT(*) AS Num FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId AND Votes.VoteTypeId = 1 GROUP BY Votes.CreationDate ORDER BY Votes.CreationDate | sede |
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,
... | 这个叫章乐悦的团伙成员最常开的药品排序都是什么? | SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_NM = '章乐悦' GROUP BY t_kc22.SOC_SRT_DIRE_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_19530 (
"No. in series" real,
"Title" text,
"Directed by" text,
"Written by" text,
"Original air date" text,
"Production code" text
) | When did the show directed by Michael Dimartino first air? | SELECT "Original air date" FROM table_19530 WHERE "Directed by" = 'Michael DiMartino' | wikisql |
CREATE TABLE table_20747 (
"Home team" text,
"Home team score" text,
"Away team" text,
"Away team score" text,
"Ground" text,
"Date" text,
"Crowd" real
) | Name the home team for football park | SELECT "Home team" FROM table_20747 WHERE "Ground" = 'Football Park' | wikisql |
CREATE TABLE station (
id int,
network_name text,
services text,
local_authority text
)
CREATE TABLE train (
id int,
train_number int,
name text,
origin text,
destination text,
time text,
interval text
)
CREATE TABLE route (
train_id int,
station_id int
)
CREATE TA... | Give me the times and numbers of all trains that go to Chennai. | SELECT time, train_number FROM train WHERE destination = 'Chennai' | nvbench |
CREATE TABLE table_79026 (
"Position" real,
"Club" text,
"Played" real,
"Points" real,
"Wins" real,
"Draws" real,
"Losses" real,
"Goals for" real,
"Goals against" real,
"Goal Difference" real
) | What is the goals for when played is larger than 30? | SELECT MIN("Goals for") FROM table_79026 WHERE "Played" > '30' | wikisql |
CREATE TABLE table_20665 (
"Code" real,
"County" text,
"Former Province" text,
"Area (km 2 )" text,
"Population Census 2009" real,
"Capital" text
) | In what former province was the area 694.9 kilometers squared? | SELECT "Former Province" FROM table_20665 WHERE "Area (km 2 )" = '694.9' | wikisql |
CREATE TABLE table_203_344 (
id number,
"#" number,
"date" text,
"opponent" text,
"score" text,
"win" text,
"loss" text,
"save" text,
"attendance" number,
"record" text,
"other info" text
) | which game had the most attendance ? | SELECT "#" FROM table_203_344 ORDER BY "attendance" DESC LIMIT 1 | squall |
CREATE TABLE table_23612439_2 (
final_score VARCHAR,
attendance VARCHAR
) | What is the final score when 22210 is the attendance? | SELECT final_score FROM table_23612439_2 WHERE attendance = 22210 | sql_create_context |
CREATE TABLE table_203_322 (
id number,
"club" text,
"played" number,
"won" number,
"drawn" number,
"lost" number,
"points for" number,
"points against" number,
"bonus points" number,
"points" number
) | what is the difference of the number of won games between stade toulousain and ca brive ? | SELECT (SELECT "won" FROM table_203_322 WHERE "club" = 'stade toulousain') - (SELECT "won" FROM table_203_322 WHERE "club" = 'ca brive') | squall |
CREATE TABLE table_22822468_2 (
share INTEGER,
viewers__millions_ VARCHAR
) | Name the most share for 2.76 million viewers | SELECT MAX(share) FROM table_22822468_2 WHERE viewers__millions_ = "2.76" | sql_create_context |
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... | tell me the cost of a protein - csf lab test. | SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'protein - csf') | eicu |
CREATE TABLE city (
city_id number,
county_id number,
name text,
white number,
black number,
amerindian number,
asian number,
multiracial number,
hispanic number
)
CREATE TABLE county_public_safety (
county_id number,
name text,
population number,
police_officers num... | Return the hispanic percentage for cities in which the black percentage is greater than 10. | SELECT hispanic FROM city WHERE black > 10 | spider |
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE flight_leg (
flight_id int,
leg_number int,
leg_flight int
)
CREATE TABLE airline (
airline_code varchar,
airline_name text,
note text
)
CREATE TABLE ground_service (
city_code text,
airp... | what flights do you have from BOSTON to PITTSBURGH on wednesday of next week after 1800 | 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 = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time... | atis |
CREATE TABLE table_204_52 (
id number,
"#" number,
"date" text,
"venue" text,
"opponent" text,
"score" text,
"result" text,
"competition" text
) | what opponent is below belgium ? | SELECT "opponent" FROM table_204_52 WHERE id = (SELECT id FROM table_204_52 WHERE "opponent" = 'belgium') + 1 | squall |
CREATE TABLE table_203_30 (
id number,
"place" number,
"team" text,
"played" number,
"won" number,
"draw" number,
"lost" number,
"goals\nscored" number,
"goals\nconceded" number,
"+/-" number,
"points" number
) | which team came in last place ? | SELECT "team" FROM table_203_30 ORDER BY "place" DESC LIMIT 1 | squall |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE diagnoses (
... | provide the number of patients whose admission year is less than 2156 and item id is 51383? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2156" AND lab.itemid = "51383" | mimicsql_data |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE d_icd_procedures (
row_id number,
icd9_code text,
s... | in the first hospital encounter what are the insurance names of patient 15135? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1 | mimic_iii |
CREATE TABLE table_19611329_1 (
inducted_as VARCHAR,
player VARCHAR
) | Name the inducted as for joe medwick category:articles with hcards | SELECT inducted_as FROM table_19611329_1 WHERE player = "Joe Medwick Category:Articles with hCards" | 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... | count the number of patients who had lab test calculated tbg and died on or before 2148. | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2148.0" AND lab.label = "Calculated TBG" | mimicsql_data |
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 Gradeconversion (
lettergrade VARCHAR(2),
gradepoint FLOAT
)
CREATE TABLE Minor_in (
StuID INTEGER,
... | Visualize a bar chart about the distribution of Days and the amount of Days , and group by attribute Days. | SELECT Days, COUNT(Days) FROM Course GROUP BY Days ORDER BY Credits | nvbench |
CREATE TABLE table_75025 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Attendance" text,
"Record" text
) | Record of 22 20 involved what score? | SELECT "Score" FROM table_75025 WHERE "Record" = '22–20' | wikisql |
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... | 列出在医院5382017中患者戚欣合就诊科室名称包含肾科的所有医疗就诊记录有哪些? | SELECT * FROM gwyjzb WHERE gwyjzb.PERSON_NM = '戚欣合' AND gwyjzb.MED_SER_ORG_NO = '5382017' AND gwyjzb.MED_ORG_DEPT_NM LIKE '%肾科%' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.PERSON_NM = '戚欣合' AND fgwyjzb.MED_SER_ORG_NO = '5382017' AND fgwyjzb.MED_ORG_DEPT_NM LIKE '%肾科%' | css |
CREATE TABLE table_26168687_3 (
vessel_type VARCHAR,
vessel_operator VARCHAR
) | What is the vessel type for vessel operator Jumbo shipping? | SELECT vessel_type FROM table_26168687_3 WHERE vessel_operator = "Jumbo Shipping" | sql_create_context |
CREATE TABLE table_203_461 (
id number,
"dvd title" text,
"discs" number,
"year" text,
"no. of ep." number,
"dvd release\nregion 2" text,
"dvd release\nregion 4" text
) | what comes immediately after complete series 11 ? | SELECT "dvd title" FROM table_203_461 WHERE id = (SELECT id FROM table_203_461 WHERE "dvd title" = 'complete series 11') + 1 | squall |
CREATE TABLE icustays (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
first_careunit text,
last_careunit text,
first_wardid number,
last_wardid number,
intime time,
outtime time
)
CREATE TABLE labevents (
row_id number,
subject_id number,
hadm_... | what are the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with abdom aortic aneurysm until 2100? | SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, 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.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_... | mimic_iii |
CREATE TABLE table_1859855_2 (
age INTEGER,
hometown VARCHAR
) | When columbia, south carolina is the hometown what is the lowest age? | SELECT MIN(age) FROM table_1859855_2 WHERE hometown = "Columbia, South Carolina" | sql_create_context |
CREATE TABLE ReviewRejectionReasons (
Id number,
Name text,
Description text,
PostTypeId number
)
CREATE TABLE PostHistory (
Id number,
PostHistoryTypeId number,
PostId number,
RevisionGUID other,
CreationDate time,
UserId number,
UserDisplayName text,
Comment text,
... | 50 most viewed questions on Ask Ubuntu on 2015-03-08. | SELECT * FROM Posts, PostTypes WHERE Posts.PostTypeId = PostTypes.Id AND PostTypes.Id = 1 AND Posts.CreationDate BETWEEN '2015-03-08 00:00:00' AND '2015-03-08 23:59:59' ORDER BY Posts.ViewCount DESC LIMIT 50 | sede |
CREATE TABLE table_name_30 (
date VARCHAR,
venue VARCHAR
) | What date(s) was the game(s) at Candlestick Park? | SELECT date FROM table_name_30 WHERE venue = "candlestick park" | sql_create_context |
CREATE TABLE table_36443 (
"Game" real,
"November" real,
"Opponent" text,
"Score" text,
"Record" text,
"Points" real
) | What Vancouver canucks game was on a date closest to November 4? | SELECT MAX("Game") FROM table_36443 WHERE "Opponent" = 'vancouver canucks' AND "November" < '4' | wikisql |
CREATE TABLE table_15700367_4 (
wickets VARCHAR,
overs_bowled VARCHAR
) | Name the wickets when overs bowled is 9 | SELECT wickets FROM table_15700367_4 WHERE overs_bowled = "9" | sql_create_context |
CREATE TABLE table_5641 (
"Gatchaman" text,
"Battle of the Planets" text,
"G-Force" text,
"Eagle Riders" text,
"OVA (Harmony Gold Dub)" text,
"Rank" text,
"Bird Uniform" text,
"Weapon" text,
"Mecha" text,
"Japanese voice actor" text,
"Voice actor (BOTP)" text,
"Voice acto... | What is the rank of the gatchaman of Jinpei? | SELECT "Rank" FROM table_5641 WHERE "Gatchaman" = 'jinpei' | wikisql |
CREATE TABLE table_name_96 (
place VARCHAR,
to_par VARCHAR
) | What is the Place of the Player with a To par of 6? | SELECT place FROM table_name_96 WHERE to_par = "–6" | sql_create_context |
CREATE TABLE table_name_17 (
goals_scored VARCHAR,
played VARCHAR,
points VARCHAR,
goals_conceded VARCHAR
) | What is the total goals scored with more than 11 points, 18 goals conceded, and played fewer than 18 times? | SELECT COUNT(goals_scored) FROM table_name_17 WHERE points > 11 AND goals_conceded = 18 AND played < 18 | sql_create_context |
CREATE TABLE trip (
id INTEGER,
duration INTEGER,
start_date TEXT,
start_station_name TEXT,
start_station_id INTEGER,
end_date TEXT,
end_station_name TEXT,
end_station_id INTEGER,
bike_id INTEGER,
subscription_type TEXT,
zip_code INTEGER
)
CREATE TABLE station (
id INTEG... | What is the average cloud cover rates of the dates (bin into year interval) that had the top 5 cloud cover rates? You can draw me a bar chart for this purpose, and order by the the average of cloud cover in descending please. | SELECT date, AVG(cloud_cover) FROM weather ORDER BY AVG(cloud_cover) DESC | nvbench |
CREATE TABLE table_17585 (
"Rank" real,
"Peak" text,
"Elevation (m)" real,
"Prominence (m)" real,
"Isolation (km)" real,
"Municipality" text,
"County" text
) | What is the county with an elevation of 1262? | SELECT "County" FROM table_17585 WHERE "Elevation (m)" = '1262' | wikisql |
CREATE TABLE table_63149 (
"Time" text,
"Home team" text,
"Score" text,
"Away team" text,
"Venue" text
) | What time is it for the southern home team? | SELECT "Time" FROM table_63149 WHERE "Home team" = 'southern' | wikisql |
CREATE TABLE table_910 (
"Local Government Area" text,
"Principal town" text,
"Land Area (km\u00b2)" text,
"Population 2011 census" real,
"Density" text,
"Region" text
) | What is the population density in the Brighton area? | SELECT "Density" FROM table_910 WHERE "Principal town" = 'Brighton' | wikisql |
CREATE TABLE table_name_96 (
mary_davis VARCHAR,
gay_mitchell VARCHAR
) | What is the Mary Davis with a Gay Mitchell that is 4.6%? | SELECT mary_davis FROM table_name_96 WHERE gay_mitchell = "4.6%" | sql_create_context |
CREATE TABLE table_53311 (
"Name" text,
"Circuit" text,
"Date" text,
"Winning driver" text,
"Winning constructor" text,
"Report" text
) | Tell me the report with winner of louis wagner | SELECT "Report" FROM table_53311 WHERE "Winning driver" = 'louis wagner' | wikisql |
CREATE TABLE table_name_70 (
b_score INTEGER,
total VARCHAR,
position VARCHAR
) | What is the B Score when the total is more than 16.125, and position is 3rd? | SELECT SUM(b_score) FROM table_name_70 WHERE total > 16.125 AND position = "3rd" | sql_create_context |
CREATE TABLE jybgb (
BBCJBW text,
BBDM text,
BBMC text,
BBZT number,
BGDH text,
BGJGDM text,
BGJGMC text,
BGRGH text,
BGRQ time,
BGRXM text,
BGSJ time,
CJRQ time,
JSBBRQSJ time,
JSBBSJ time,
JYBBH text,
JYJGMC text,
JYJSGH text,
JYJSQM text,
JY... | 显示23126323这个患者住在医院2184508的所有记录里,出院的时候科室名字没有美容两个字的住院记载 | SELECT * FROM hz_info JOIN zyjzjlb ON hz_info.YLJGDM = zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX WHERE hz_info.RYBH = '23126323' AND hz_info.YLJGDM = '2184508' AND NOT zyjzjlb.CYKSMC LIKE '%美容%' | 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 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, draw a bar chart about the distribution of hire_date and the average of employee_id bin hire_date by weekday, display from high to low by the total number. | SELECT HIRE_DATE, AVG(EMPLOYEE_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(EMPLOYEE_ID) DESC | nvbench |
CREATE TABLE table_18703133_6 (
scored INTEGER,
position VARCHAR
) | What is scored with the position of 6? | SELECT MIN(scored) FROM table_18703133_6 WHERE position = 6 | sql_create_context |
CREATE TABLE requirement (
requirement_id int,
requirement varchar,
college varchar
)
CREATE TABLE student (
student_id int,
lastname varchar,
firstname varchar,
program_id int,
declare_major varchar,
total_credit int,
total_gpa float,
entered_as varchar,
admit_term int,... | I need to leave for work at 5:00 every day , so if I take 499 and 162 , can I do that ? | 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.number = 499 OR course.number = 162) AND course_offering.end_time > '17:00:00' AND semester.semester = 'WN' AND semester.year = ... | advising |
CREATE TABLE table_1930857_1 (
gender VARCHAR,
year_founded VARCHAR
) | What's the gender of the students taught in the school founded in 1894? | SELECT gender FROM table_1930857_1 WHERE year_founded = "1894" | sql_create_context |
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,
... | 哪个人门诊就诊中开出的检验报告单21844290233 | SELECT person_info.XM FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jybgb JOIN person_info_hz_info ON person_info.RYBH = person_info_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_MZJZ... | css |
CREATE TABLE allergy (
allergyid number,
patientunitstayid number,
drugname text,
allergyname text,
allergytime time
)
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number... | has patient 012-63986 been prescribed sublimaze, dextrose 50%, or lorazepam in this month? | SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-63986')) AND medication.drugname IN ('sublimaze', 'dextrose 50%', 'lor... | eicu |
CREATE TABLE Behavior_Incident (
incident_id INTEGER,
incident_type_code VARCHAR(10),
student_id INTEGER,
date_incident_start DATETIME,
date_incident_end DATETIME,
incident_summary VARCHAR(255),
recommendations VARCHAR(255),
other_details VARCHAR(255)
)
CREATE TABLE Ref_Incident_Type (
... | Return a bar chart about the distribution of date_address_from and the sum of monthly_rental , and group by attribute other_details and bin date_address_from by time. | SELECT date_address_from, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_19418696_3 (
yards VARCHAR,
qb_rating VARCHAR
) | How many yardage figures for the player with 72.3 QB rating? | SELECT COUNT(yards) FROM table_19418696_3 WHERE qb_rating = "72.3" | sql_create_context |
CREATE TABLE table_36278 (
"Game" real,
"Date" text,
"Opponent" text,
"Score" text,
"Location" text,
"Record" text
) | When the record was 7-2, what was the score for the game? | SELECT "Score" FROM table_36278 WHERE "Record" = '7-2' | wikisql |
CREATE TABLE table_49739 (
"Place" text,
"Player" text,
"Country" text,
"Score" text,
"To par" text,
"Money ( $ )" real
) | What Player had a Score of 75-73-68-65=281 and more than 19,009 in Money? | SELECT "Player" FROM table_49739 WHERE "Money ( $ )" > '19,009' AND "Score" = '75-73-68-65=281' | wikisql |
CREATE TABLE table_name_84 (
location VARCHAR,
record VARCHAR
) | What is the location of the match with the record 10-8-1? | SELECT location FROM table_name_84 WHERE record = "10-8-1" | sql_create_context |
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
) | Bar chart of mean price from each name, order names in desc order. | SELECT Name, AVG(Price) FROM Products GROUP BY Name ORDER BY Name DESC | nvbench |
CREATE TABLE table_19651669_1 (
final_venue VARCHAR,
season VARCHAR
) | How many final venues were there in the 1997-98 season? | SELECT COUNT(final_venue) FROM table_19651669_1 WHERE season = "1997-98" | sql_create_context |
CREATE TABLE table_name_45 (
league_goals INTEGER,
player VARCHAR
) | How many total League goals does Player John O'Flynn have? | SELECT SUM(league_goals) FROM table_name_45 WHERE player = "john o'flynn" | sql_create_context |
CREATE TABLE customers (
customer_id number,
customer_address_id number,
customer_status_code text,
date_became_customer time,
date_of_birth time,
first_name text,
last_name text,
amount_outstanding number,
email_address text,
phone_number text,
cell_mobile_phone_number text
... | What is the maximum, minimum, and average amount of money outsanding for all customers? | SELECT MAX(amount_outstanding), MIN(amount_outstanding), AVG(amount_outstanding) FROM customers | spider |
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 microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_ty... | on their last hospital visit there was any organism found in patient 6374's last mrsa screen test? | SELECT COUNT(*) > 0 FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 6374 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) AND microbiologyevents.spec_type_desc = 'mrsa screen' AND NOT microbiologyevents.... | mimic_iii |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE PostTags (
PostId number,
TagId number
)
CREATE TABLE CloseAsOffTopicReasonTypes (
Id number,
... | How much reputation are you getting from your past work?. Take the 'unexpected' reputation coming from your answers from last month.
Suppose now you constantly get those, and figure out how much rep per day you are getting for your past work without 'working for it' on that given day | SELECT Users.Id, usersAnswers.Answers, Users.Reputation, (Users.Reputation / UsersAnswers.Answers) AS Ratio FROM (SELECT U.Id, COUNT(Posts.Id) AS Answers FROM Posts, Users AS U WHERE Posts.OwnerUserId = U.Id AND Posts.PostTypeId = 2 GROUP BY U.Id) AS UsersAnswers, Users WHERE UsersAnswers.Id = Users.Id ORDER BY Ratio D... | sede |
CREATE TABLE table_1305623_12 (
gold_medals VARCHAR,
total_medals VARCHAR
) | How many gold medals does each school who has a total of 1 medal have? | SELECT gold_medals FROM table_1305623_12 WHERE total_medals = 1 | sql_create_context |
CREATE TABLE table_16226584_1 (
name VARCHAR,
km_from_kingston VARCHAR
) | Which railroad is 112.6 kilometers from kingston? | SELECT name FROM table_16226584_1 WHERE km_from_kingston = "112.6" | sql_create_context |
CREATE TABLE table_488 (
"Celebrity" text,
"Background" text,
"Original Team" text,
"Age" real,
"Hometown" text,
"Charity" text,
"Result" text,
"Raised" text
) | Which is the charity that the background of the celebrity is heavyweight champion? | SELECT "Charity" FROM table_488 WHERE "Background" = 'Heavyweight Champion' | wikisql |
CREATE TABLE table_34414 (
"Country" text,
"Project Name" text,
"Year startup" text,
"Operator" text,
"Peak" text
) | What year was the startup for the Project Named of taq taq ph 2? | SELECT "Year startup" FROM table_34414 WHERE "Project Name" = 'taq taq ph 2' | wikisql |
CREATE TABLE table_203_665 (
id number,
"name" text,
"municipality" text,
"established" number,
"tower height\nin meters (ft)" text,
"focal plane\nin meters (ft)" text,
"current status" text,
"current condition" text
) | the difference in years from 1882 to 1889 | SELECT 1889 - 1882 | squall |
CREATE TABLE table_69270 (
"Race" text,
"Dist (f)" real,
"Course" text,
"Prize (\u00a3K)" real,
"Runners" real,
"Placing" real,
"Margin" text,
"Jockey" text,
"Trainer" text
) | How many total runners had jockeys of Olivier Peslier with placings under 2? | SELECT SUM("Runners") FROM table_69270 WHERE "Jockey" = 'olivier peslier' AND "Placing" < '2' | wikisql |
CREATE TABLE table_37850 (
"Position" real,
"Team" text,
"Points" real,
"Played" real,
"Drawn" real,
"Lost" real,
"Against" real,
"Difference" text
) | Difference of - 20, and a Position smaller than 17 is the highest against? | SELECT MAX("Against") FROM table_37850 WHERE "Difference" = '- 20' AND "Position" < '17' | wikisql |
CREATE TABLE table_name_49 (
winner VARCHAR,
course VARCHAR
) | Who won the course Brescia? | SELECT winner FROM table_name_49 WHERE course = "brescia" | sql_create_context |
CREATE TABLE table_11843 (
"Date" text,
"Opponent" text,
"Score" text,
"Loss" text,
"Record" text
) | Name the score on august 1 | SELECT "Score" FROM table_11843 WHERE "Date" = 'august 1' | wikisql |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.