context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) 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 airport_service (...
what does the airline code DL stand for
SELECT DISTINCT airline_code FROM airline WHERE airline_code = 'DL'
atis
CREATE TABLE table_name_69 ( date VARCHAR, competition VARCHAR, result VARCHAR )
On what date was a friendly competition and a result of 3 0?
SELECT date FROM table_name_69 WHERE competition = "friendly" AND result = "3–0"
sql_create_context
CREATE TABLE table_name_57 ( date VARCHAR, record VARCHAR )
What is the Date of the game where the Cavaliers have a Record of 15-27?
SELECT date FROM table_name_57 WHERE record = "15-27"
sql_create_context
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
Which artist release the most CDs?
SELECT artist FROM torrents GROUP BY artist ORDER BY COUNT(groupname) DESC LIMIT 1
whatcdhiphop
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 age is less than 47 and lab test fluid is joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "47" AND lab.fluid = "Joint Fluid"
mimicsql_data
CREATE TABLE table_35332 ( "Rank" real, "Player" text, "Country" text, "Earnings ( $ )" real, "Wins" real )
What is the rank of Greg Norman who earned more than $12,507,322?
SELECT AVG("Rank") FROM table_35332 WHERE "Player" = 'greg norman' AND "Earnings ( $ )" > '12,507,322'
wikisql
CREATE TABLE festival_detail ( Festival_ID int, Festival_Name text, Chair_Name text, Location text, Year int, Num_of_Audience int ) CREATE TABLE nomination ( Artwork_ID int, Festival_ID int, Result text ) CREATE TABLE artwork ( Artwork_ID int, Type text, Name text )
, I want to list by the bars from low to high please.
SELECT Type, COUNT(*) FROM artwork GROUP BY Type ORDER BY Type
nvbench
CREATE TABLE table_28593 ( "Engine Family" text, "Cylinder Layout" text, "Displacement(s)" text, "Injection type" text, "Years produced" text )
The displacement(s) 466 cubic inches (7.6L), has what engine family?
SELECT "Engine Family" FROM table_28593 WHERE "Displacement(s)" = '466 cubic inches (7.6L)'
wikisql
CREATE TABLE table_name_83 ( years_active VARCHAR, wins VARCHAR )
What is the total number of 2nd place finishes for riders active in years 2009-2010 and more than 0 wins?
SELECT SUM(2 AS nd_pl) FROM table_name_83 WHERE years_active = "2009-2010" AND wins > 0
sql_create_context
CREATE TABLE table_name_82 ( week INTEGER, date VARCHAR )
What is the low week from october 15, 1961?
SELECT MIN(week) FROM table_name_82 WHERE date = "october 15, 1961"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients are below 27 years of age and admitted before the year 2123?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "27" AND demographic.admityear < "2123"
mimicsql_data
CREATE TABLE table_name_77 ( studio VARCHAR, year VARCHAR, title VARCHAR )
What was the studio for The Hard Way in 1943?
SELECT studio FROM table_name_77 WHERE year = 1943 AND title = "the hard way"
sql_create_context
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...
这家号码是1054385的医院结算的医疗就诊记录里有哪些是在03年3月19号到08年5月29号期间非异地结算的?
SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '1054385' AND gwyjzb.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' UNION SELECT * FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '1054385' AND fgwyjzb.IN_HOSP_DATE BETWEEN '2003-03-19' AND '2008-05-29' EXCEPT SELECT * FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '105438...
css
CREATE TABLE table_2287 ( "Type" text, "Beam height (mm)" real, "Flange width (mm)" real, "Web thickness (mm)" text, "Flange thickness (mm)" text, "Weight (kg/m)" text, "Cross-section area (cm 2 )" text, "Moment of inertia in torsion (J) (cm 4 )" text )
What is the web thickness if the flange width is 100?
SELECT "Web thickness (mm)" FROM table_2287 WHERE "Flange width (mm)" = '100'
wikisql
CREATE TABLE table_60005 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What Country has a Player of nick faldo?
SELECT "Country" FROM table_60005 WHERE "Player" = 'nick faldo'
wikisql
CREATE TABLE table_27932399_1 ( release_date VARCHAR, release_title VARCHAR )
What is the release date of 'New Worlds for Old'?
SELECT release_date FROM table_27932399_1 WHERE release_title = "New Worlds For Old"
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients are single and tested in lab for hyaline casts?
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 = "Hyaline Casts"
mimicsql_data
CREATE TABLE table_203_764 ( id number, "name" text, "date" number, "nation" text, "displacement" text, "speed" text, "number" number, "notes" text )
how many consecutive escorts were in 1943 ?
SELECT COUNT(*) FROM table_203_764 WHERE "date" = '1943'
squall
CREATE TABLE table_203_223 ( id number, "name" text, "gauge" text, "builder" text, "type" text, "date" number, "works number" number, "notes" text )
list each date represented by locomotives at the museum .
SELECT "date" FROM table_203_223
squall
CREATE TABLE table_77734 ( "Round" real, "Player" text, "Position" text, "Nationality" text, "College/Junior/Club team (League)" text )
What position does Zack Torquato play?
SELECT "Position" FROM table_77734 WHERE "Player" = 'zack torquato'
wikisql
CREATE TABLE table_11803648_17 ( round INTEGER, position VARCHAR )
WHAT ROUND WAS FORWARD ANDRE PETERSSON SELECTED?
SELECT MIN(round) FROM table_11803648_17 WHERE position = "Forward"
sql_create_context
CREATE TABLE table_34591 ( "Position" real, "Team" text, "Points" real, "Played" real, "Drawn" real, "Lost" real, "Against" real, "Difference" text )
How many positions had a difference of - 4 and an against of less than 24?
SELECT COUNT("Position") FROM table_34591 WHERE "Difference" = '- 4' AND "Against" < '24'
wikisql
CREATE TABLE table_name_36 ( league_cup INTEGER, championship VARCHAR, total VARCHAR )
How many league cups associated with under 10 championships and a total of under 3?
SELECT SUM(league_cup) FROM table_name_36 WHERE championship < 10 AND total < 3
sql_create_context
CREATE TABLE table_47579 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Primary Language(s)" text, "Director" text, "Result" text )
What is Primary Language(s), when Director is 'Ilgar Safat Category:Articles With hCards'?
SELECT "Primary Language(s)" FROM table_47579 WHERE "Director" = 'ilgar safat category:articles with hcards'
wikisql
CREATE TABLE table_42137 ( "Office" text, "Republican ticket" text, "Democratic ticket" text, "Conservative ticket" text, "Liberal ticket" text, "Socialist Labor ticket" text, "Socialist Workers ticket" text )
Which republican ticket has stanley h. fuld as the Democratic ticket?
SELECT "Republican ticket" FROM table_42137 WHERE "Democratic ticket" = 'stanley h. fuld'
wikisql
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE d_items ( row_id number, itemid ...
until 2104, what was the yearly minimum weight of patient 25523?
SELECT MIN(chartevents.valuenum) FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 25523)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admi...
mimic_iii
CREATE TABLE table_name_13 ( competition VARCHAR, year VARCHAR, notes VARCHAR )
Which Competition has a Year smaller than 2009, and Notes of 56.16 m?
SELECT competition FROM table_name_13 WHERE year < 2009 AND notes = "56.16 m"
sql_create_context
CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE date_day ( month_number int, day_number int, year int, day_name var...
give me return flights from PHILADELPHIA to SAN FRANCISCO for 12 3
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 = 'SAN FRANCISCO' AND date_day.day_number = 3 AND date_day.month_number = 12...
atis
CREATE TABLE table_49708 ( "Exit Date" text, "Pos." text, "Player" text, "To club" text, "Transfer fee" text )
What was the date that a player went to the club Doncaster Rovers?
SELECT "Exit Date" FROM table_49708 WHERE "To club" = 'doncaster rovers'
wikisql
CREATE TABLE table_50598 ( "Rank" real, "Team" text, "Played" real, "Wins" real, "Ties" real, "Losses" real, "Goals For" real, "Goals Against" real, "Points" real )
What are the total goals against the winner with less than 5 wins, and less than 5 plays?
SELECT COUNT("Goals Against") FROM table_50598 WHERE "Wins" < '5' AND "Played" < '5'
wikisql
CREATE TABLE t_kc22 ( AMOUNT number, CHA_ITEM_LEV number, DATA_ID text, DIRE_TYPE number, DOSE_FORM text, DOSE_UNIT text, EACH_DOSAGE text, EXP_OCC_DATE time, FLX_MED_ORG_ID text, FXBZ number, HOSP_DOC_CD text, HOSP_DOC_NM text, MED_DIRE_CD text, MED_DIRE_NM text,...
看一下给患者陈雪曼开出的各药品的名称及其每次用量和使用频次,在医疗就诊29931144185中
SELECT t_kc22.SOC_SRT_DIRE_NM, t_kc22.EACH_DOSAGE, t_kc22.USE_FRE FROM t_kc22 JOIN t_kc21_t_kc22 JOIN t_kc21 ON t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID AND t_kc21_t_kc22.MED_CLINIC_ID = t_kc21.MED_CLINIC_ID WHERE t_kc21.MED_CLINIC_ID = '29931144185'
css
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 ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( ...
how many patients whose admission year is less than 2198 and drug name is gentamicin sulfate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2198" AND prescriptions.drug = "Gentamicin Sulfate"
mimicsql_data
CREATE TABLE table_40637 ( "Year" real, "Award" text, "Category" text, "Nomination" text, "Result" text )
Which award is in the category of best music video?
SELECT "Award" FROM table_40637 WHERE "Category" = 'best music video'
wikisql
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, give me the comparison about revenue over the name , and group by attribute name, and rank from low to high by the Name please.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
nvbench
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE d_icd_diagnoses ( row_id n...
what's the number of patients who have had hearing loss nos diagnosed in the last year?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hearing loss nos') AND DATETIME(diagnoses_icd.charttime, '...
mimic_iii
CREATE TABLE table_40714 ( "Television service" text, "Country" text, "Language" text, "Content" text, "HDTV" text, "Package/Option" text )
What is Television Service, when Content is Presentazione?
SELECT "Television service" FROM table_40714 WHERE "Content" = 'presentazione'
wikisql
CREATE TABLE table_78579 ( "Model" text, "Engine" text, "Cyl." text, "Power" text, "Torque" text )
Which Torque has a Model of s63 amg ('01)?
SELECT "Torque" FROM table_78579 WHERE "Model" = 's63 amg (''01)'
wikisql
CREATE TABLE table_52363 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
in a game against st kilda, what was the away team's score?
SELECT "Away team" FROM table_52363 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_65181 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What date was the tie number of 32?
SELECT "Date" FROM table_65181 WHERE "Tie no" = '32'
wikisql
CREATE TABLE Accounts ( account_id VARCHAR, customer_id VARCHAR, account_name VARCHAR )
Show ids, customer ids, names for all accounts.
SELECT account_id, customer_id, account_name FROM Accounts
sql_create_context
CREATE TABLE table_name_87 ( title VARCHAR, prod_code VARCHAR )
What is the title of the episode with production code 40811-002?
SELECT title FROM table_name_87 WHERE prod_code = "40811-002"
sql_create_context
CREATE TABLE table_23426 ( "Team" text, "Province" text, "Owner(s)" text, "Price" text, "Captain" text, "Head coach" text, "Icon Player" text )
What province does the Ruhuna Royals team come from?
SELECT "Province" FROM table_23426 WHERE "Team" = 'Ruhuna Royals'
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...
查查患者蒋新蕾在医院0734262中被开的所有药和编码,时间范围是在2010年12月29日到2012年6月26日
SELECT t_kc22.SOC_SRT_DIRE_CD, t_kc22.SOC_SRT_DIRE_NM FROM t_kc22 WHERE t_kc22.MED_CLINIC_ID IN (SELECT qtb.MED_CLINIC_ID FROM qtb WHERE qtb.PERSON_NM = '蒋新蕾' AND qtb.MED_SER_ORG_NO = '0734262' AND qtb.IN_HOSP_DATE BETWEEN '2010-12-29' AND '2012-06-26' UNION SELECT gyb.MED_CLINIC_ID FROM gyb WHERE gyb.PERSON_NM = '蒋新蕾'...
css
CREATE TABLE company ( company_id number, name text, headquarters text, industry text, sales_in_billion number, profits_in_billion number, assets_in_billion number, market_value_in_billion number ) CREATE TABLE people ( people_id number, age number, name text, nationalit...
Show the different headquarters and number of companies at each headquarter.
SELECT headquarters, COUNT(*) FROM company GROUP BY headquarters
spider
CREATE TABLE table_23292220_4 ( episode VARCHAR, seans_team VARCHAR )
Which episode has ulrika jonsson and michael mcintyre on sean's team?
SELECT episode FROM table_23292220_4 WHERE seans_team = "Ulrika Jonsson and Michael McIntyre"
sql_create_context
CREATE TABLE table_64710 ( "Group" text, "Name" text, "Nationality" text, "4.00" text, "Result" text )
Roslinda Samsu has what nationality?
SELECT "Nationality" FROM table_64710 WHERE "Name" = 'roslinda samsu'
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 prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, ...
how many patients whose admission year is less than 2146 and lab test name is ptt?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2146" AND lab.label = "PTT"
mimicsql_data
CREATE TABLE table_42392 ( "Team" text, "Match" real, "Points" real, "Draw" real, "Lost" real )
What is the highest number of draws with 6 losses and less than 15 points?
SELECT MAX("Draw") FROM table_42392 WHERE "Lost" = '6' AND "Points" < '15'
wikisql
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...
how many hours have elapsed since patient 93078 last received a laboratory phosphate test on this hospital visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', labevents.charttime)) FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'phosphate') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 93078 AND admissio...
mimic_iii
CREATE TABLE table_203_778 ( id number, "representative" text, "title" text, "presentation\nof credentials" text, "termination\nof mission" text, "appointed by" text )
how many representatives were appointed by theodore roosevelt ?
SELECT COUNT("title") FROM table_203_778 WHERE "appointed by" = 'theodore roosevelt'
squall
CREATE TABLE table_name_68 ( year_named VARCHAR, name VARCHAR, diameter VARCHAR )
How many years is ur sulcus listed with a diameter less than 1,145.0?
SELECT COUNT(year_named) FROM table_name_68 WHERE name = "ur sulcus" AND diameter < 1 OFFSET 145.0
sql_create_context
CREATE TABLE event ( ID int, Name text, Stadium_ID int, Year text ) CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE record ( ID int, Result text, Swimmer_ID int, Event_ID int ) CREATE TABLE swimme...
Draw a bar chart about the distribution of Nationality and the sum of meter_100 , and group by attribute Nationality, and I want to display by the total number in ascending.
SELECT Nationality, SUM(meter_100) FROM swimmer GROUP BY Nationality ORDER BY SUM(meter_100)
nvbench
CREATE TABLE table_name_75 ( date_sent VARCHAR, hd_designation VARCHAR, signal_power___kw__ VARCHAR, arrival_date VARCHAR )
What is Date Sent, when Signal Power ( kW ) is less than 126, when Arrival Date is 'January 2059', and when HD Designation is 'HD193664'?
SELECT date_sent FROM table_name_75 WHERE signal_power___kw__ < 126 AND arrival_date = "january 2059" AND hd_designation = "hd193664"
sql_create_context
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE medication ( medicatio...
how many times did patient 022-187132 do a output (ml)-chest tube #2 mediastinal lower;anterior on the current intensive care unit visit?
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-187132') AND patient.unitdischargetime IS NULL) AND intakeoutput.cellp...
eicu
CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real ) CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int...
Find those years for all exhibitions with ticket prices lower than 15, group by year, and count year, and display by the the number of year from high to low.
SELECT Year, COUNT(Year) FROM exhibition WHERE Ticket_Price < 15 GROUP BY Year ORDER BY COUNT(Year) DESC
nvbench
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,...
are there any LIMOUSINE or TAXI services available at the BOS airport
SELECT DISTINCT ground_service.transport_type FROM airport, ground_service WHERE (ground_service.transport_type = 'LIMOUSINE' OR ground_service.transport_type = 'TAXI') AND airport.airport_code = 'BOS' AND ground_service.airport_code = airport.airport_code
atis
CREATE TABLE table_9071 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which opponent has a week smaller than 15, and a Result of l 23-17?
SELECT "Opponent" FROM table_9071 WHERE "Week" < '15' AND "Result" = 'l 23-17'
wikisql
CREATE TABLE table_41614 ( "Name" text, "Subdivisions" text, "Area (km\u00b2)" real, "Population (1 July 2005 est.)" real, "Population density (per km\u00b2)" real, "Capital" text )
What is Population density (per km ), when Name is Antigua and Barbuda, and when Capital is St. John's?
SELECT "Population density (per km\u00b2)" FROM table_41614 WHERE "Name" = 'antigua and barbuda' AND "Capital" = 'st. john''s'
wikisql
CREATE TABLE table_20174050_24 ( company VARCHAR, author VARCHAR )
which company released audiobooks authored by day, martin martin day
SELECT company FROM table_20174050_24 WHERE author = "Day, Martin Martin Day"
sql_create_context
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE employees ( EMPLOYEE_ID decimal(6,0),...
For those employees who do not work in departments with managers that have ids between 100 and 200, give me the comparison about department_id over the last_name by a bar chart, rank by the y axis from high to low please.
SELECT LAST_NAME, DEPARTMENT_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY DEPARTMENT_ID DESC
nvbench
CREATE TABLE genre ( g_name text, rating text, most_popular_in text ) CREATE TABLE files ( f_id number, artist_name text, file_size text, duration text, formats text ) CREATE TABLE artist ( artist_name text, country text, gender text, preferred_genre text ) CREATE TABL...
What are the ids of songs that are available in either mp4 format or have resolution above 720?
SELECT f_id FROM files WHERE formats = "mp4" UNION SELECT f_id FROM song WHERE resolution > 720
spider
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...
Accepted answers with zero score.
SELECT answers.Id AS "post_link" FROM (SELECT * FROM Posts WHERE PostTypeId = 2) AS answers JOIN (SELECT * FROM Posts WHERE PostTypeId = 1) AS questions ON questions.AcceptedAnswerId = answers.Id WHERE answers.OwnerUserId = @UserId AND answers.Score = 0
sede
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
give me the number of patients whose ethnicity is black/cape verdean and procedure icd9 code is 8674?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND procedures.icd9_code = "8674"
mimicsql_data
CREATE TABLE table_21671 ( "Season in Tamil" text, "English Transliteration" text, "English Translation" text, "Season in Sanskrit" text, "Season in English" text, "Tamil Months" text, "Gregorian Months" text )
How many seasons in Tamil occur when the season in Sanskrit is Grishma?
SELECT COUNT("Season in Tamil") FROM table_21671 WHERE "Season in Sanskrit" = 'Grishma'
wikisql
CREATE TABLE table_24417 ( "Year" real, "Song Title" text, "Artist" text, "Genre" text, "Original Game" text, "Band Tier/Venue" text, "Exportable to GH5/BH" text )
What is every original game for the artist Lynyrd Skynyrd?
SELECT "Original Game" FROM table_24417 WHERE "Artist" = 'Lynyrd Skynyrd'
wikisql
CREATE TABLE table_204_996 ( id number, "no." text, "air date" text, "network" text, "household\nrating" number, "viewers\n(millions)" text )
13.7 million watched the 22nd year . how many watched the previous year ?
SELECT "viewers\n(millions)" FROM table_204_996 WHERE "no." = 22 - 1
squall
CREATE TABLE table_name_63 ( played INTEGER, lost VARCHAR, against VARCHAR )
Which Played has a Lost of 3, and an Against of 23?
SELECT AVG(played) FROM table_name_63 WHERE lost = 3 AND against = 23
sql_create_context
CREATE TABLE table_name_76 ( initial_syllable_open_semi_open_unstressed_vowels VARCHAR )
What is 17th c., when Initial-Syllable Open/Semi-Open Unstressed Vowels is 'o / /'?
SELECT 17 AS th_c FROM table_name_76 WHERE initial_syllable_open_semi_open_unstressed_vowels = "o /ɵ/"
sql_create_context
CREATE TABLE exhibition_record ( Exhibition_ID int, Date text, Attendance int ) CREATE TABLE artist ( Artist_ID int, Name text, Country text, Year_Join int, Age int ) CREATE TABLE exhibition ( Exhibition_ID int, Year int, Theme text, Artist_ID int, Ticket_Price real...
Find dates and attendance for exhibitions that happened in 2004, show me the proportion of attendance by date.
SELECT Date, Attendance FROM exhibition_record AS T1 JOIN exhibition AS T2 ON T1.Exhibition_ID = T2.Exhibition_ID WHERE T2.Year = 2004
nvbench
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_days text ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturd...
what FIRST class flights are available from DENVER to BALTIMORE on 7 25 1991
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 AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis AS FARE_BASIS_0, fare_basis AS FARE_BASIS_1, flight, flight_fare WHERE ((DATE...
atis
CREATE TABLE table_14836185_3 ( money_list_rank INTEGER )
What was the highest number on money list rank for Angela Stanford's career?
SELECT MAX(money_list_rank) FROM table_14836185_3
sql_create_context
CREATE TABLE STUDENT ( Major VARCHAR, StuID VARCHAR ) CREATE TABLE VOTING_RECORD ( Treasurer_Vote VARCHAR )
Find the distinct majors of students who have treasurer votes.
SELECT DISTINCT T1.Major FROM STUDENT AS T1 JOIN VOTING_RECORD AS T2 ON T1.StuID = T2.Treasurer_Vote
sql_create_context
CREATE TABLE table_66269 ( "Date" text, "Venue" text, "Score" text, "Result" text, "Competition" text )
What venue has euro 2004 q. as the competition?
SELECT "Venue" FROM table_66269 WHERE "Competition" = 'euro 2004 q.'
wikisql
CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time...
calculate the amount of albumin 5% patient 20898 has taken since 599 days ago.
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 20898)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.lab...
mimic_iii
CREATE TABLE table_name_65 ( opponent VARCHAR, field VARCHAR )
What was the opponent for the game at Multi-sport Field?
SELECT opponent FROM table_name_65 WHERE field = "multi-sport field"
sql_create_context
CREATE TABLE table_name_13 ( current_club VARCHAR, player VARCHAR, year_born VARCHAR, height VARCHAR, position VARCHAR )
What team does tariq kirksay, a guard who is taller than 1.8M and born before 1982, represent?
SELECT current_club FROM table_name_13 WHERE height > 1.8 AND position = "guard" AND year_born < 1982 AND player = "tariq kirksay"
sql_create_context
CREATE TABLE jybgb_jyjgzbb ( JYZBLSH number, YLJGDM text, jyjgzbb_id number ) CREATE TABLE person_info ( CSD text, CSRQ time, GJDM text, GJMC text, JGDM text, JGMC text, MZDM text, MZMC text, RYBH text, XBDM number, XBMC text, XLDM text, XLMC text, XM...
在医疗就诊36725122883的云盈秀患者进行过检查的各检验科室的编码及名称都是啥?
SELECT jybgb.JYKSBM, jybgb.JYKSMC FROM jybgb WHERE jybgb.JZLSH = '36725122883'
css
CREATE TABLE table_name_19 ( bronze INTEGER, silver INTEGER )
What is the number of bronze medals when there are fewer than 0 silver medals?
SELECT SUM(bronze) FROM table_name_19 WHERE silver < 0
sql_create_context
CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(15), product_name VARCHAR(80), product_price DOUBLE ) CREATE TABLE Customer_Orders ( order_id INTEGER, customer_id INTEGER, order_date DATETIME, order_status_code VARCHAR(15) ) CREATE TABLE Addresses ( address_id...
Show the number of customer address history in each day and group by date to with a line chart, and I want to sort by the x axis in descending.
SELECT date_to, COUNT(date_to) FROM Customer_Address_History AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id JOIN Addresses AS T3 ON T1.address_id = T3.address_id GROUP BY date_to ORDER BY date_to DESC
nvbench
CREATE TABLE table_60612 ( "Position" real, "Team" text, "Played" real, "Drawn" real, "Lost" real, "Goals For" real, "Goals Against" real, "Goal Difference" text, "Points 1" text )
What is the lowest position with points 1 of 27 2 and fewer than 9 drawn?
SELECT MIN("Position") FROM table_60612 WHERE "Points 1" = '27 2' AND "Drawn" < '9'
wikisql
CREATE TABLE Department ( DepartmentID INTEGER, Name VARCHAR(30), Head INTEGER ) CREATE TABLE Undergoes ( Patient INTEGER, Procedures INTEGER, Stay INTEGER, DateUndergoes DATETIME, Physician INTEGER, AssistingNurse INTEGER ) CREATE TABLE Physician ( EmployeeID INTEGER, Name...
A bar chart for listing the number of the names of patients who have made appointments, I want to sort by the y axis from high to low.
SELECT Name, COUNT(Name) FROM Appointment AS T1 JOIN Patient AS T2 ON T1.Patient = T2.SSN GROUP BY Name ORDER BY COUNT(Name) DESC
nvbench
CREATE TABLE table_4617 ( "Line" text, "Color" text, "Terminus" text, "Length" text, "Stations" text, "Daily Ridership" real )
The color sapphire is assigned to which Terminus?
SELECT "Terminus" FROM table_4617 WHERE "Color" = 'sapphire'
wikisql
CREATE TABLE torrents ( groupname text, totalsnatched number, artist text, groupyear number, releasetype text, groupid number, id number ) CREATE TABLE tags ( index number, id number, tag text )
Which year has the most CDs released?
SELECT groupyear FROM torrents GROUP BY groupyear ORDER BY COUNT(groupname) DESC LIMIT 1
whatcdhiphop
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...
列出医疗就诊记录中医疗费总额与医疗就诊18542009470相同的的ID、人员ID、人员姓名、公民身份号码、人员性别、人员年龄都是什么啊?
SELECT gwyjzb.MED_CLINIC_ID, gwyjzb.PERSON_ID, gwyjzb.PERSON_NM, gwyjzb.IDENTITY_CARD, gwyjzb.PERSON_SEX, gwyjzb.PERSON_AGE FROM gwyjzb JOIN t_kc24 ON gwyjzb.MED_CLINIC_ID = t_kc24.MED_CLINIC_ID WHERE t_kc24.MED_AMOUT = (SELECT t_kc24.MED_AMOUT FROM t_kc24 WHERE t_kc24.MED_CLINIC_ID = '18542009470') UNION SELECT fgwyjz...
css
CREATE TABLE table_72846 ( "Poll Year" text, "Winner" text, "Second" text, "Third" text, "Fourth" text, "Fifth" text, "Sixth" text, "Seventh" text, "Eighth" text, "Ninth" text, "Tenth" text )
How many times was Plan B 4th place?
SELECT COUNT("Winner") FROM table_72846 WHERE "Fourth" = 'Plan B'
wikisql
CREATE TABLE table_name_63 ( player VARCHAR, team VARCHAR )
Who is the player on a team from the 1970s?
SELECT player FROM table_name_63 WHERE team = "1970s"
sql_create_context
CREATE TABLE table_41274 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Director" text, "Result" text )
What is Original title, when Film title used in nomination is Train Without A Timetable?
SELECT "Original title" FROM table_41274 WHERE "Film title used in nomination" = 'train without a timetable'
wikisql
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, ...
想知道有哪些医院给患者56628366开过厄贝沙坦片(薄膜衣)
SELECT t_kc21.MED_SER_ORG_NO FROM t_kc21 WHERE t_kc21.PERSON_ID = '56628366' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc22.MED_CLINIC_ID FROM t_kc22 WHERE t_kc22.SOC_SRT_DIRE_NM = '厄贝沙坦片(薄膜衣)')
css
CREATE TABLE captain ( Captain_ID int, Name text, Ship_ID int, age text, Class text, Rank text ) CREATE TABLE Ship ( Ship_ID int, Name text, Type text, Built_Year real, Class text, Flag text )
What is the total number of captains in each rank and class? Let class as X-axis, and categorize by rank with a stacked bar chart, rank by the X-axis in ascending.
SELECT Class, COUNT(Class) FROM captain GROUP BY Rank, Class ORDER BY Class
nvbench
CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREATE TABLE course_tags_count ( course_id int, clear_grading int, pop_quiz int, group_projects int, inspirational int, long_lectures int, extra_credit int, few_tests int, good_feedback int, ...
How many people are in 477 ?
SELECT DISTINCT num_enrolled FROM course WHERE department = 'EECS' AND number = 477
advising
CREATE TABLE candidate ( Candidate_ID int, People_ID int, Poll_Source text, Date text, Support_rate real, Consider_rate real, Oppose_rate real, Unsure_rate real ) CREATE TABLE people ( People_ID int, Sex text, Name text, Date_of_Birth text, Height real, Weight re...
A bar chart shows the distribution of Name and Height , and I want to show by the y axis in descending.
SELECT Name, Height FROM people ORDER BY Height DESC
nvbench
CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) ...
give me the number of patients born before 2200 who had lab test item id 50882.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dob_year < "2200" AND lab.itemid = "50882"
mimicsql_data
CREATE TABLE furniture ( Furniture_ID int, Name text, Num_of_Component int, Market_Rate real ) CREATE TABLE furniture_manufacte ( Manufacturer_ID int, Furniture_ID int, Price_in_Dollar real ) CREATE TABLE manufacturer ( Manufacturer_ID int, Open_Year real, Name text, Num_of...
Find the component amounts and names of all furnitures that have more than 10 components. Show me the proportion of component amounts using a pie chart.
SELECT Name, Num_of_Component FROM furniture WHERE Num_of_Component > 10
nvbench
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...
在医院4694071所有的就诊记载里,依科室不同的编号和入院诊断的疾病编号不同查查民政补助的开销与全部医疗费之比的最大值,然后把结果从大到小排一下
SELECT t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM, MAX(t_kc24.CIVIL_SUBSIDY) FROM t_kc24 WHERE t_kc24.t_kc21_MED_SER_ORG_NO = '4694071' GROUP BY t_kc24.t_kc21_MED_ORG_DEPT_CD, t_kc24.t_kc21_IN_DIAG_DIS_NM ORDER BY MAX(t_kc24.CIVIL_SUBSIDY / t_kc24.MED_AMOUT) DESC
css
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...
specify the gender of patient id 2560 and drug code he was treated with.
SELECT demographic.gender, prescriptions.formulary_drug_cd FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.subject_id = "2560"
mimicsql_data
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CR...
what was patient 11362 first height in 11/this year?
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11362)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'admit ht'...
mimic_iii
CREATE TABLE table_68183 ( "Name" text, "From" text, "Discipline" text, "Events won (UK Series)" real, "Events won (US Series)" real )
How many US events did jason bennett win?
SELECT AVG("Events won (US Series)") FROM table_68183 WHERE "Name" = 'jason bennett'
wikisql
CREATE TABLE table_204_30 ( id number, "year built" text, "works number" number, "wheel arr." text, "gauge" text, "original owner" text, "name" text, "current location" text, "notes" text )
which original owner had the most locomotives ?
SELECT "original owner" FROM table_204_30 GROUP BY "original owner" ORDER BY COUNT(*) DESC LIMIT 1
squall
CREATE TABLE table_62209 ( "Name" text, "Club" text, "Date of departure" text, "Replacement" text, "Date of appointment" text )
What is the name of the manager who was replaced by michael skibbe?
SELECT "Name" FROM table_62209 WHERE "Replacement" = 'michael skibbe'
wikisql
CREATE TABLE Apartment_Bookings ( apt_id VARCHAR, booking_status_code VARCHAR ) CREATE TABLE Apartments ( apt_id VARCHAR )
Show the average room count of the apartments that have booking status code 'Provisional'.
SELECT AVG(room_count) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T1.booking_status_code = "Provisional"
sql_create_context