context stringlengths 11 9.12k | question stringlengths 0 1.06k | SQL stringlengths 2 4.44k | source stringclasses 28
values |
|---|---|---|---|
CREATE TABLE table_17207 (
"Round" real,
"Overall" text,
"Player" text,
"Position" text,
"Nationality" text,
"Club team" text
) | Which player is in round 5? | SELECT "Player" FROM table_17207 WHERE "Round" = '5' | wikisql |
CREATE TABLE table_79735 (
"Number" real,
"Builder" text,
"Built" text,
"Rebuilt" text,
"Name as rebuilt" text,
"Scrapped/Sold" text
) | Which Scrapped/Sold has a Name as rebuilt of trostan? | SELECT "Scrapped/Sold" FROM table_79735 WHERE "Name as rebuilt" = 'trostan' | wikisql |
CREATE TABLE table_17358515_1 (
points_2 VARCHAR,
team VARCHAR
) | How many points did Goole Town accumulate? | SELECT COUNT(points_2) FROM table_17358515_1 WHERE team = "Goole Town" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
r... | on 11 23 of this year 1991 i'd like to fly from ATLANTA to DENVER and i'd like to fly on DL | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND date_day.day_number = 23 AND date_day.month_number = 11 AND ... | atis |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | how many patients whose primary disease is bladder cancer/sda and procedure short title is percu endosc gastrostomy? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "BLADDER CANCER/SDA" AND procedures.short_title = "Percu endosc gastrostomy" | mimicsql_data |
CREATE TABLE table_1231316_6 (
wind__m_s_ VARCHAR,
athlete VARCHAR
) | Name the total number of wind m/s for sunday emmanuel | SELECT COUNT(wind__m_s_) FROM table_1231316_6 WHERE athlete = "Sunday Emmanuel" | sql_create_context |
CREATE TABLE table_212 (
"Rnd" real,
"Race" text,
"Date" text,
"Location" text,
"Pole Position" text,
"Fastest Lap" text,
"Race Winner" text,
"Constructor" text,
"Report" text
) | Who did the fastest lap at Watkins glen? | SELECT "Fastest Lap" FROM table_212 WHERE "Location" = 'Watkins Glen' | wikisql |
CREATE TABLE t_kc22 (
MED_EXP_DET_ID text,
OVERALL_CD_ORG text,
OVERALL_CD_PERSON text,
MED_CLINIC_ID text,
MED_EXP_BILL_ID text,
SOC_SRT_DIRE_CD text,
SOC_SRT_DIRE_NM text,
DIRE_TYPE number,
CHA_ITEM_LEV number,
MED_INV_ITEM_TYPE text,
MED_DIRE_CD text,
MED_DIRE_NM text,... | 这个名叫窦清润的团伙成员最常去的医生排序是什么样的? | SELECT OUT_DIAG_DOC_CD, OUT_DIAG_DOC_NM FROM t_kc21 WHERE PERSON_NM = '窦清润' GROUP BY OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_22297198_3 (
manner_of_departure VARCHAR,
outgoing_manager VARCHAR
) | Why did Majid bagherinia leave? | SELECT manner_of_departure FROM table_22297198_3 WHERE outgoing_manager = "Majid Bagherinia" | sql_create_context |
CREATE TABLE table_name_42 (
rowers VARCHAR,
rank VARCHAR,
country VARCHAR
) | Who are the rowers ranked greater than 3 from Finland? | SELECT rowers FROM table_name_42 WHERE rank > 3 AND country = "finland" | sql_create_context |
CREATE TABLE table_20432 (
"Episode Number" real,
"Air Date" text,
"Guest Host" text,
"Musical Guest (Song performed)" text,
"Who knows the most about the guest host? panelists" text,
"Coat Of Cash Wearing Celebrity" text
) | Name the total number of panelists for 19 january 2007 | SELECT COUNT("Who knows the most about the guest host? panelists") FROM table_20432 WHERE "Air Date" = '19 January 2007' | wikisql |
CREATE TABLE table_46160 (
"Year" real,
"Tournament" text,
"Venue" text,
"Result" text,
"Extra" text
) | What year did anna thompson have a 7th place result? | SELECT "Year" FROM table_46160 WHERE "Result" = '7th' | wikisql |
CREATE TABLE table_55406 (
"Rank" real,
"Nation" text,
"Gold" real,
"Silver" real,
"Bronze" real,
"Total" real
) | What's the total number of gold where the total is less than 23 and the rank is over 10? | SELECT COUNT("Gold") FROM table_55406 WHERE "Total" < '23' AND "Rank" > '10' | wikisql |
CREATE TABLE demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob text,
gender text,
language text,
religion text,
admission_type text,
days_stay text,
insurance text,
ethnicity text,
expire_flag text,
admission_location t... | what is admission location of subject name kelly gallardo? | SELECT demographic.admission_location FROM demographic WHERE demographic.name = "Kelly Gallardo" | mimicsql_data |
CREATE TABLE Ship (
Ship_ID int,
Name text,
Type text,
Built_Year real,
Class text,
Flag text
)
CREATE TABLE captain (
Captain_ID int,
Name text,
Ship_ID int,
age text,
Class text,
Rank text
) | A bar chart about how many captains are in each rank?, and rank in desc by the the total number please. | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank ORDER BY COUNT(*) DESC | nvbench |
CREATE TABLE mzjzjlb (
HXPLC number,
HZXM text,
JLSJ time,
JZJSSJ time,
JZKSBM text,
JZKSMC text,
JZKSRQ time,
JZLSH text,
JZZDBM text,
JZZDSM text,
JZZTDM number,
JZZTMC text,
KH text,
KLX number,
MJZH text,
ML number,
MZZYZDZZBM text,
MZZYZDZZMC ... | 沈元纬这个病人做的脸部检验的各项指标结果如何 | SELECT * FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb 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 AND jybgb.YLJGDM = jyjgzbb.YLJGDM AND jybgb.BGDH = jyjgzbb.BGDH WHERE hz_info.person_i... | css |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | specify the death status of patient id 2560 | SELECT demographic.expire_flag FROM demographic WHERE demographic.subject_id = "2560" | mimicsql_data |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE treatment (
treatmentid number,
patientunitstayid number,
treatmentname text,
treatmenttime time
)
CREATE TABLE vitalperiodic (
vitalperiodicid number,
... | how many days since the first time patient 030-42006 was diagnosed in this hospital encounter with bone fracture(s) - thoracic spine? | SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', diagnosis.diagnosistime)) FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006'... | eicu |
CREATE TABLE organisation_types (
organisation_type text,
organisation_type_description text
)
CREATE TABLE research_staff (
staff_id number,
employer_organisation_id number,
staff_details text
)
CREATE TABLE project_outcomes (
project_id number,
outcome_code text,
outcome_details text... | Which role is most common for the staff? | SELECT role_code FROM project_staff GROUP BY role_code ORDER BY COUNT(*) DESC LIMIT 1 | spider |
CREATE TABLE table_name_78 (
commissioned VARCHAR,
ship_name VARCHAR
) | When was the ship BRP Miguel Malvar commissioned? | SELECT commissioned FROM table_name_78 WHERE ship_name = "brp miguel malvar" | sql_create_context |
CREATE TABLE equipment_sequence (
aircraft_code_sequence varchar,
aircraft_code varchar
)
CREATE TABLE time_interval (
period text,
begin_time int,
end_time int
)
CREATE TABLE time_zone (
time_zone_code text,
time_zone_name text,
hours_from_gmt int
)
CREATE TABLE compartment_class (
... | what flights are available from DENVER to PHILADELPHIA on monday | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND date_day.day_number = 21 AND date_day.month_number = 2 ... | atis |
CREATE TABLE table_67842 (
"Rank" real,
"Team" text,
"Wins" real,
"Losses" real,
"Runs Allowed" real,
"Run Ratio" real
) | How many total wins did the team ranked lower than 1 with a run ratio less than 5.85 and more than 4 losses have? | SELECT COUNT("Wins") FROM table_67842 WHERE "Rank" > '1' AND "Run Ratio" < '5.85' AND "Losses" > '4' | wikisql |
CREATE TABLE ground_service (
city_code text,
airport_code text,
transport_type text,
ground_fare int
)
CREATE TABLE fare_basis (
fare_basis_code text,
booking_class text,
class_type text,
premium text,
economy text,
discounted text,
night text,
season text,
basis_da... | show me all flights from SAN FRANCISCO 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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = '... | atis |
CREATE TABLE table_27713030_11 (
record VARCHAR,
location_attendance VARCHAR
) | What was the record for the location and attendance of american airlines arena 19,825? | SELECT record FROM table_27713030_11 WHERE location_attendance = "American Airlines Arena 19,825" | sql_create_context |
CREATE TABLE aircraft (
Aircraft_ID int,
Order_Year int,
Manufacturer text,
Model text,
Fleet_Series text,
Powertrain text,
Fuel_Propulsion text
)
CREATE TABLE pilot (
Pilot_ID int,
Pilot_name text,
Rank int,
Age int,
Nationality text,
Position text,
Join_Year in... | Bar chart of the number of position from each position, list by the names in desc. | SELECT Position, COUNT(Position) FROM pilot GROUP BY Position ORDER BY Position DESC | nvbench |
CREATE TABLE table_name_64 (
name_of_ship VARCHAR,
date VARCHAR
) | What is the Name of the Ship attacked on 20February1942? | SELECT name_of_ship FROM table_name_64 WHERE date = "20february1942" | sql_create_context |
CREATE TABLE lab (
labid number,
patientunitstayid number,
labname text,
labresult number,
labresulttime time
)
CREATE TABLE medication (
medicationid number,
patientunitstayid number,
drugname text,
dosage text,
routeadmin text,
drugstarttime time,
drugstoptime time
)
... | had sepsis been diagnosed with patient 015-33415 until 2104? | SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '015-33415')) AND diagnosis.diagnosisname = 'sepsis' AND STRFTIME('%y', diagn... | eicu |
CREATE TABLE stadium (
ID int,
name text,
Capacity int,
City text,
Country text,
Opening_year int
)
CREATE TABLE event (
ID int,
Name text,
Stadium_ID int,
Year text
)
CREATE TABLE swimmer (
ID int,
name text,
Nationality text,
meter_100 real,
meter_200 text... | Give me the comparison about meter_100 over the meter_400 , show in descending by the total number. | SELECT meter_400, meter_100 FROM swimmer ORDER BY meter_100 DESC | nvbench |
CREATE TABLE table_name_32 (
trofeo_fast_team VARCHAR,
stage VARCHAR
) | who was the trofeo fast team in stage 10? | SELECT trofeo_fast_team FROM table_name_32 WHERE stage = "10" | sql_create_context |
CREATE TABLE table_39092 (
"Club" text,
"Played" 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
) | When the losing bonus was 2 what was drawn score? | SELECT "Drawn" FROM table_39092 WHERE "Losing bonus" = '2' | wikisql |
CREATE TABLE table_name_10 (
score VARCHAR,
home VARCHAR
) | What was the score when Edmonton was the home team? | SELECT score FROM table_name_10 WHERE home = "edmonton" | sql_create_context |
CREATE TABLE table_name_91 (
score VARCHAR,
competition VARCHAR
) | What was the score of the 2014 World Cup Qualification? | SELECT score FROM table_name_91 WHERE competition = "2014 world cup qualification" | sql_create_context |
CREATE TABLE table_name_38 (
silver INTEGER,
nation VARCHAR,
gold VARCHAR
) | what is the silver when the nation is syria (syr) and gold is more than 0? | SELECT SUM(silver) FROM table_name_38 WHERE nation = "syria (syr)" AND gold > 0 | sql_create_context |
CREATE TABLE table_15664 (
"Name" text,
"Years" text,
"Gender" text,
"Area" text,
"Authority" text,
"Decile" real
) | Tkkm o te ara rima has a decile less than 4 in what years? | SELECT "Years" FROM table_15664 WHERE "Decile" < '4' AND "Name" = 'tkkm o te ara rima' | wikisql |
CREATE TABLE outputevents (
row_id number,
subject_id number,
hadm_id number,
icustay_id number,
charttime time,
itemid number,
value number
)
CREATE TABLE admissions (
row_id number,
subject_id number,
hadm_id number,
admittime time,
dischtime time,
admission_type t... | what were the hospital admissions times of patient 72364 during this year? | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 72364 AND DATETIME(admissions.admittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') | mimic_iii |
CREATE TABLE table_name_25 (
opponent VARCHAR,
attendance VARCHAR
) | Who was the Opponent when the Attendance was 38,150? | SELECT opponent FROM table_name_25 WHERE attendance = "38,150" | sql_create_context |
CREATE TABLE table_204_806 (
id number,
"name" text,
"date" text,
"condition" text,
"ownership\n/ access" text,
"notes" text
) | how many of these castles are currently in ruins ? | SELECT COUNT(*) FROM table_204_806 WHERE "condition" = 'ruins' | squall |
CREATE TABLE table_24075 (
"Episode" text,
"Broadcast date" text,
"Run time" text,
"Viewers (in millions)" text,
"Archive" text
) | On broadcast date is 21march1970, how many people tuned in? | SELECT COUNT("Viewers (in millions)") FROM table_24075 WHERE "Broadcast date" = '21March1970' | wikisql |
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 admission year is less than 2107? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admityear < "2107" | mimicsql_data |
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 demographic (
subject_id text,
hadm_id text,
name text,
marital_status text,
age text,
dob te... | count the number of patients whose insurance is self pay and procedure long title is monitoring of cardiac output by other technique? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Self Pay" AND procedures.long_title = "Monitoring of cardiac output by other technique" | mimicsql_data |
CREATE TABLE table_203_394 (
id number,
"title" text,
"author" text,
"date" number,
"length\n(first edition)" text
) | what year was the earliest bull dog drummond published ? | SELECT "date" FROM table_203_394 WHERE "title" = 'bull-dog drummond' ORDER BY "date" LIMIT 1 | squall |
CREATE TABLE table_76435 (
"Outcome" text,
"Date" text,
"Tournament" text,
"Surface" text,
"Partner" text,
"Opponents in the final" text,
"Score" text
) | What was the date for the match where Tweedie-Yates' partner was jodi kenoyer? | SELECT "Date" FROM table_76435 WHERE "Partner" = 'jodi kenoyer' | wikisql |
CREATE TABLE table_name_10 (
school_club_team VARCHAR,
years_for_grizzlies VARCHAR
) | What's the school that played for the Grizzlie from 1995-1998? | SELECT school_club_team FROM table_name_10 WHERE years_for_grizzlies = "1995-1998" | sql_create_context |
CREATE TABLE countries (
COUNTRY_ID varchar(2),
COUNTRY_NAME varchar(40),
REGION_ID decimal(10,0)
)
CREATE TABLE regions (
REGION_ID decimal(5,0),
REGION_NAME varchar(25)
)
CREATE TABLE locations (
LOCATION_ID decimal(4,0),
STREET_ADDRESS varchar(40),
POSTAL_CODE varchar(12),
CITY ... | For all employees who have the letters D or S in their first name, give me the trend about manager_id over hire_date . | SELECT HIRE_DATE, MANAGER_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' | nvbench |
CREATE TABLE table_29557 (
"Season" text,
"Points per Game" text,
"Total Yards per Game" text,
"Rushing Yards per Game" text,
"Passing Yards per Game" text,
"Sacks" text,
"Interceptions" text
) | How many seasons have a sacks of 39? | SELECT COUNT("Season") FROM table_29557 WHERE "Sacks" = '39' | wikisql |
CREATE TABLE table_16046689_29 (
conference_matchups VARCHAR,
date VARCHAR,
bowl_game VARCHAR
) | What teams played in the Capital One bowl game on January 1, 2009? | SELECT conference_matchups FROM table_16046689_29 WHERE date = "January 1, 2009" AND bowl_game = "Capital One" | sql_create_context |
CREATE TABLE table_name_78 (
title VARCHAR,
name VARCHAR
) | What is the title of Amenemhat II? | SELECT title FROM table_name_78 WHERE name = "amenemhat ii" | sql_create_context |
CREATE TABLE table_name_13 (
regulations VARCHAR,
winning_drivers VARCHAR
) | What regulations have carlos arzani as the winning driver? | SELECT regulations FROM table_name_13 WHERE winning_drivers = "carlos arzani" | sql_create_context |
CREATE TABLE table_6306 (
"Date" text,
"Venue" text,
"Score" text,
"Result" text,
"Competition" text
) | What is the venue of the match on 5 April 2000? | SELECT "Venue" FROM table_6306 WHERE "Date" = '5 april 2000' | wikisql |
CREATE TABLE table_70179 (
"Pick #" text,
"Player" text,
"Position" text,
"Nationality" text,
"NHL team" text,
"College/junior/club team" text
) | What nationality is the #63 pick? | SELECT "Nationality" FROM table_70179 WHERE "Pick #" = '63' | wikisql |
CREATE TABLE Ref_Address_Types (
address_type_code VARCHAR(15),
address_type_description VARCHAR(80)
)
CREATE TABLE Students (
student_id INTEGER,
address_id INTEGER,
first_name VARCHAR(80),
middle_name VARCHAR(40),
last_name VARCHAR(40),
cell_mobile_number VARCHAR(40),
email_addres... | Visualize a bar chart about the distribution of date_address_to and the average of monthly_rental , and group by attribute other_details and bin date_address_to by weekday. | SELECT date_address_to, AVG(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC | nvbench |
CREATE TABLE table_22977424_8 (
name VARCHAR,
promoted_to_league VARCHAR
) | Name the name for doncaster newbury | SELECT name FROM table_22977424_8 WHERE promoted_to_league = "Doncaster Newbury" | sql_create_context |
CREATE TABLE table_name_7 (
attendance INTEGER,
date VARCHAR
) | How many people were in attendance on may 17? | SELECT MIN(attendance) FROM table_name_7 WHERE date = "may 17" | sql_create_context |
CREATE TABLE table_36874 (
"Club" text,
"Sport" text,
"League" text,
"Venue" text,
"Established" real,
"Championships" real
) | How many championships does Evergreen Premier League have? | SELECT MAX("Championships") FROM table_36874 WHERE "League" = 'evergreen premier league' | wikisql |
CREATE TABLE table_203_366 (
id number,
"pos" number,
"class" text,
"no" number,
"team" text,
"drivers" text,
"chassis" text,
"engine" text,
"laps" number
) | which team completed the most laps ? | SELECT "team" FROM table_203_366 ORDER BY "laps" DESC LIMIT 1 | squall |
CREATE TABLE table_35657 (
"Year" real,
"League" text,
"Class" text,
"Record" text,
"Finish" text,
"Manager" text,
"Playoffs" text
) | Manager of marty berghammer, and a Finish of 1st involved what lowest year? | SELECT MIN("Year") FROM table_35657 WHERE "Manager" = 'marty berghammer' AND "Finish" = '1st' | wikisql |
CREATE TABLE table_name_50 (
number_s_ VARCHAR,
quantity VARCHAR
) | What number corresponds to the quantity of 24? | SELECT number_s_ FROM table_name_50 WHERE quantity = "24" | sql_create_context |
CREATE TABLE d_labitems (
row_id number,
itemid number,
label text
)
CREATE TABLE microbiologyevents (
row_id number,
subject_id number,
hadm_id number,
charttime time,
spec_type_desc text,
org_name text
)
CREATE TABLE d_icd_diagnoses (
row_id number,
icd9_code text,
sh... | what was patient 83709's insurance name on their last hospital encounter? | SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 83709 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1 | mimic_iii |
CREATE TABLE Claim_Headers (
Claim_Header_ID INTEGER,
Claim_Status_Code CHAR(15),
Claim_Type_Code CHAR(15),
Policy_ID INTEGER,
Date_of_Claim DATETIME,
Date_of_Settlement DATETIME,
Amount_Claimed DECIMAL(20,4),
Amount_Piad DECIMAL(20,4)
)
CREATE TABLE Staff (
Staff_ID INTEGER,
St... | Find the number of records of each policy type and its type code Visualize by bar chart, I want to list by the y axis in asc. | SELECT Policy_Type_Code, COUNT(*) FROM Policies GROUP BY Policy_Type_Code ORDER BY COUNT(*) | nvbench |
CREATE TABLE table_204_698 (
id number,
"name" text,
"lifetime" text,
"nationality" text,
"notable as" text,
"notes" text
) | which nationality had the larger amount of names listed ? | SELECT "nationality" FROM table_204_698 GROUP BY "nationality" ORDER BY COUNT("name") DESC LIMIT 1 | squall |
CREATE TABLE table_74338 (
"Team" text,
"Stadium" text,
"Home Games" real,
"Average Attendance" real,
"Total Attendance" real,
"Capacity Percentage" text
) | What was the total attendance of the New York Giants? | SELECT MIN("Total Attendance") FROM table_74338 WHERE "Team" = 'New York Giants' | wikisql |
CREATE TABLE area (
course_id int,
area varchar
)
CREATE TABLE ta (
campus_job_id int,
student_id int,
location varchar
)
CREATE TABLE course (
course_id int,
name varchar,
department varchar,
number varchar,
credits varchar,
advisory_requirement varchar,
enforced_requi... | Who is going to teach Stage Management for this semester ? | SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester... | advising |
CREATE TABLE table_16099880_5 (
winning_driver VARCHAR,
race VARCHAR
) | In what position did the winning driver finish at Chicagoland? | SELECT COUNT(winning_driver) FROM table_16099880_5 WHERE race = "Chicagoland" | sql_create_context |
CREATE TABLE table_name_74 (
cultural_and_educational_panel INTEGER,
nominated_by_the_taoiseach VARCHAR,
total VARCHAR
) | What is the smallest cultural and educational panel with a nominated by the Taoiseach less than 5 and the total greater than 19? | SELECT MIN(cultural_and_educational_panel) FROM table_name_74 WHERE nominated_by_the_taoiseach < 5 AND total > 19 | 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 have at least 1000 listed for enrollment ? | SELECT COUNT("institution") FROM table_203_135 WHERE "enrollment" >= 1000 | squall |
CREATE TABLE table_204_328 (
id number,
"no." number,
"date" text,
"tournament" text,
"winning score" text,
"margin of\nvictory" text,
"runner(s)-up" text
) | was the margin of victory in the lpga championship the same as in the sunstar classic ? | SELECT (SELECT "margin of\nvictory" FROM table_204_328 WHERE "tournament" = 'lpga championship') = (SELECT "margin of\nvictory" FROM table_204_328 WHERE "tournament" = 'sunstar classic') | squall |
CREATE TABLE table_76679 (
"Club" text,
"Location" text,
"Manager" text,
"Venue" text,
"Capacity" real
) | What is the total number of capacity for the venue of the club, pirin? | SELECT COUNT("Capacity") FROM table_76679 WHERE "Club" = 'pirin' | wikisql |
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 all employees who have the letters D or S in their first name, give me the trend about salary over hire_date , and could you order by the x axis from high to low? | SELECT HIRE_DATE, SALARY FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE table_name_4 (
lema_sublema VARCHAR,
ch_of_senators VARCHAR
) | Which LEMA/SUBLEMA has a Ch of Senators of 2? | SELECT lema_sublema FROM table_name_4 WHERE ch_of_senators = "2" | sql_create_context |
CREATE TABLE SuggestedEditVotes (
Id number,
SuggestedEditId number,
UserId number,
VoteTypeId number,
CreationDate time,
TargetUserId number,
TargetRepChange number
)
CREATE TABLE TagSynonyms (
Id number,
SourceTagName text,
TargetTagName text,
CreationDate time,
OwnerU... | In which part of the world is a user according to its time answer. | SELECT TIME_TO_STR(p.CreationDate, '%h'), COUNT(1) FROM Posts AS p WHERE p.OwnerUserId = @UserId GROUP BY TIME_TO_STR(p.CreationDate, '%h') | sede |
CREATE TABLE table_name_72 (
tries_against VARCHAR,
losing_bonus VARCHAR
) | How many tries against have a losing bonus of 9? | SELECT tries_against FROM table_name_72 WHERE losing_bonus = "9" | sql_create_context |
CREATE TABLE table_41251 (
"Year" real,
"Actor" text,
"Award" text,
"Series" text,
"Result" text
) | What was actor Teresa Graves's series before the year 1993? | SELECT "Series" FROM table_41251 WHERE "Year" < '1993' AND "Actor" = 'teresa graves' | wikisql |
CREATE TABLE table_name_89 (
to_par VARCHAR,
year_s__won VARCHAR
) | Which To par has a Year(s) won of 1964? | SELECT to_par FROM table_name_89 WHERE year_s__won = "1964" | sql_create_context |
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,
... | was patient 016-6009 given a beta blocker - metoprolol treatment since 1 year ago? | SELECT COUNT(*) > 0 FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-6009')) AND treatment.treatmentname = 'beta blocker - metoprolol' AND DA... | eicu |
CREATE TABLE class_of_service (
booking_class varchar,
rank int,
class_description text
)
CREATE TABLE fare (
fare_id int,
from_airport varchar,
to_airport varchar,
fare_basis_code text,
fare_airline text,
restriction_code text,
one_direction_cost int,
round_trip_cost int,
... | on 4 8 i would like to book a flight from CHARLOTTE to BALTIMORE | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BALTIMORE' AND date_day.day_number = 8 AND date_day.month_number = 4 AND ... | atis |
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... | 在哪几次医疗记录中,患者39665457被开出过金额超过7246.13元的药品?列出医疗就诊编号是什么? | SELECT t_kc21.MED_CLINIC_ID FROM t_kc21 WHERE t_kc21.PERSON_ID = '39665457' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.AMOUNT > 7246.13) | css |
CREATE TABLE musical (
musical_id number,
name text,
year number,
award text,
category text,
nominee text,
result text
)
CREATE TABLE actor (
actor_id number,
name text,
musical_id number,
character text,
duration text,
age number
) | Show names of musicals and the number of actors who have appeared in the musicals. | SELECT T2.name, COUNT(*) FROM actor AS T1 JOIN musical AS T2 ON T1.musical_id = T2.musical_id GROUP BY T1.musical_id | spider |
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, a line chart shows the trend of salary over hire_date , could you rank x-axis in desc order? | SELECT HIRE_DATE, SALARY FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE DESC | nvbench |
CREATE TABLE Badges (
Id number,
UserId number,
Name text,
Date time,
Class number,
TagBased boolean
)
CREATE TABLE PostNotices (
Id number,
PostId number,
PostNoticeTypeId number,
CreationDate time,
DeletionDate time,
ExpiryDate time,
Body text,
OwnerUserId numb... | Short WHYT comments without links. | SELECT Id FROM Comments WHERE LOWER(Text) LIKE '##pattern?what have you tried%##' AND LENGTH(Text) < '##maxlength?75##' ORDER BY LENGTH(Text), Id | sede |
CREATE TABLE table_64981 (
"Tournament" text,
"1986" text,
"1988" text,
"1989" text,
"1990" text,
"1991" text,
"1992" text,
"1993" text,
"1994" text,
"1995" text,
"1996" text,
"1997" text,
"1998" text,
"1999" text
) | What's the 1986 if 1991 has a QF and 1998 has a 3R? | SELECT "1986" FROM table_64981 WHERE "1991" = 'qf' AND "1998" = '3r' | wikisql |
CREATE TABLE table_40937 (
"Pilot" text,
"Original Airdate" text,
"Musical Guest/Song performed" text,
"YouTube Hero" text,
"MySpace Band" text
) | What is the Original Airdate for the YouTube Hero greg pattillo? | SELECT "Original Airdate" FROM table_40937 WHERE "YouTube Hero" = 'greg pattillo' | wikisql |
CREATE TABLE Rooms (
RoomId TEXT,
roomName TEXT,
beds INTEGER,
bedType TEXT,
maxOccupancy INTEGER,
basePrice INTEGER,
decor TEXT
)
CREATE TABLE Reservations (
Code INTEGER,
Room TEXT,
CheckIn TEXT,
CheckOut TEXT,
Rate REAL,
LastName TEXT,
FirstName TEXT,
Adul... | Find the number of rooms for each bed type. Visualize by bar chart. | SELECT bedType, COUNT(*) FROM Rooms GROUP BY bedType | nvbench |
CREATE TABLE table_22034853_1 (
language_s_ VARCHAR,
film_title_used_in_nomination VARCHAR
) | What was the language of 'Mein Name Ist Bach'? | SELECT language_s_ FROM table_22034853_1 WHERE film_title_used_in_nomination = "Mein Name Ist Bach" | sql_create_context |
CREATE TABLE table_1745843_9 (
part_3 VARCHAR,
part_1 VARCHAR
) | Name the part 3 for treffen | SELECT part_3 FROM table_1745843_9 WHERE part_1 = "treffen" | sql_create_context |
CREATE TABLE table_66335 (
"Name" text,
"Height" text,
"Weight" text,
"Spike" text,
"2008 club" text
) | What is the Height of the Player from the 2008 Club of RPA Perugia? | SELECT "Height" FROM table_66335 WHERE "2008 club" = 'rpa perugia' | wikisql |
CREATE TABLE table_203_512 (
id number,
"release date" text,
"album" text,
"catalog number" text,
"chart position" number,
"notes" text
) | how many albums/singles were released after the year 2000 ? | SELECT COUNT("album") FROM table_203_512 WHERE "release date" > 2000 | squall |
CREATE TABLE Apartment_Facilities (
apt_id INTEGER,
facility_code CHAR(15)
)
CREATE TABLE View_Unit_Status (
apt_id INTEGER,
apt_booking_id INTEGER,
status_date DATETIME,
available_yn BIT
)
CREATE TABLE Apartment_Buildings (
building_id INTEGER,
building_short_name CHAR(15),
buildi... | Show me a bar chart for what are the apartment number and the room count of each apartment?, and I want to sort in asc by the y axis please. | SELECT apt_number, room_count FROM Apartments ORDER BY room_count | nvbench |
CREATE TABLE table_39838 (
"Rank" text,
"s Wicket" text,
"Player" text,
"Matches" text,
"Average" text
) | What playee has 24.21 as the average? | SELECT "Player" FROM table_39838 WHERE "Average" = '24.21' | wikisql |
CREATE TABLE table_29132 (
"Name" text,
"Position" text,
"Height" text,
"Weight" real,
"Age" real,
"Home Town" text,
"Team/School" text
) | What is the name of the player from purcell, ok? | SELECT "Name" FROM table_29132 WHERE "Home Town" = 'Purcell, OK' | wikisql |
CREATE TABLE film (
Film_ID int,
Rank_in_series int,
Number_in_season int,
Title text,
Directed_by text,
Original_air_date text,
Production_code text
)
CREATE TABLE cinema (
Cinema_ID int,
Name text,
Openning_year int,
Capacity int,
Location text
)
CREATE TABLE schedule... | Show the number of films for each cinema in a pie chart. | SELECT Name, COUNT(Name) FROM schedule AS T1 JOIN film AS T2 ON T1.Film_ID = T2.Film_ID JOIN cinema AS T3 ON T1.Cinema_ID = T3.Cinema_ID GROUP BY Name | nvbench |
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... | 哪些医生是这个叫朱红叶的团伙成员最常去看的排序一下? | SELECT t_kc21.OUT_DIAG_DOC_CD, t_kc21.OUT_DIAG_DOC_NM FROM t_kc21 WHERE t_kc21.PERSON_NM = '朱红叶' GROUP BY t_kc21.OUT_DIAG_DOC_CD ORDER BY COUNT(*) DESC | css |
CREATE TABLE table_77514 (
"Name" text,
"Position" text,
"Height" text,
"Weight" real,
"Year" text,
"Home Town" text,
"High School" text
) | What is the Home Town with a Year of freshman, and a Height with 6 6? | SELECT "Home Town" FROM table_77514 WHERE "Year" = 'freshman' AND "Height" = '6–6' | wikisql |
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 ... | Average and Maximum scores. | SELECT a.Score, a.OwnerDisplayName FROM Posts AS a WHERE a.OwnerDisplayName LIKE '%zum%' | sede |
CREATE TABLE basketball_match (
Team_ID int,
School_ID int,
Team_Name text,
ACC_Regular_Season text,
ACC_Percent text,
ACC_Home text,
ACC_Road text,
All_Games text,
All_Games_Percent int,
All_Home text,
All_Road text,
All_Neutral text
)
CREATE TABLE university (
Scho... | Give me the comparison about Team_ID over the Team_Name by a bar chart, and I want to sort from low to high by the y-axis please. | SELECT Team_Name, Team_ID FROM basketball_match ORDER BY Team_ID | nvbench |
CREATE TABLE qtb (
CLINIC_ID text,
COMP_ID text,
DATA_ID text,
DIFF_PLACE_FLG number,
FERTILITY_STS number,
FLX_MED_ORG_ID text,
HOSP_LEV number,
HOSP_STS number,
IDENTITY_CARD text,
INPT_AREA_BED text,
INSURED_IDENTITY number,
INSURED_STS text,
INSU_TYPE text,
IN... | 总价格高于1924.14元的医疗费在柏和玉的医疗记录有多少,可以列出其在入院诊断出来的疾病编码和名称吗? | SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '柏和玉' AND qtb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 1924.14) UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '柏和玉' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_CLIN... | css |
CREATE TABLE diagnoses (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE procedures (
... | how many patients are with emergency admission type and the hospital stay is greater than 13 days? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.days_stay > "13" | mimicsql_data |
CREATE TABLE table_name_57 (
country VARCHAR,
player VARCHAR
) | What country is phil mickelson from? | SELECT country FROM table_name_57 WHERE player = "phil mickelson" | sql_create_context |
CREATE TABLE procedures (
subject_id text,
hadm_id text,
icd9_code text,
short_title text,
long_title text
)
CREATE TABLE lab (
subject_id text,
hadm_id text,
itemid text,
charttime text,
flag text,
value_unit text,
label text,
fluid text
)
CREATE TABLE prescription... | provide the number of patients whose insurance is medicaid and admission year is less than 2107? | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Medicaid" AND demographic.admityear < "2107" | mimicsql_data |
CREATE TABLE course (
course_id varchar(8),
title varchar(50),
dept_name varchar(20),
credits numeric(2,0)
)
CREATE TABLE time_slot (
time_slot_id varchar(4),
day varchar(1),
start_hr numeric(2),
start_min numeric(2),
end_hr numeric(2),
end_min numeric(2)
)
CREATE TABLE section... | Bar chart x axis building y axis maximal capacity, I want to show in asc by the total number please. | SELECT building, MAX(capacity) FROM classroom GROUP BY building ORDER BY MAX(capacity) | nvbench |
CREATE TABLE table_25931938_1 (
place VARCHAR,
aggregate VARCHAR
) | What was the place for the celebrity whose aggregate was 35? | SELECT place FROM table_25931938_1 WHERE aggregate = 35 | sql_create_context |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.