context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_54697 ( "Sail" text, "Yacht" text, "Syndicate" text, "Yacht Club" text, "Nation" text )
Which syndicate is associated with the stars & stripes yacht?
SELECT "Syndicate" FROM table_54697 WHERE "Yacht" = 'stars & stripes'
wikisql
CREATE TABLE table_12095519_1 ( destination VARCHAR, train_name VARCHAR )
Where does the bg express train end?
SELECT destination FROM table_12095519_1 WHERE train_name = "BG Express"
sql_create_context
CREATE TABLE table_204_877 ( id number, "place" number, "position" text, "number" number, "name" text, "league two" number, "fa cup" number, "league cup" number, "fl trophy" number, "total" number )
how many times did eastwood score ?
SELECT "total" FROM table_204_877 WHERE "name" = 'freddy eastwood'
squall
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...
门诊给患者67854437诊断为疾病N63.585,那检测指标342923的结果定量及单位是什么
SELECT jyjgzbb.JCZBJGDL, jyjgzbb.JCZBJGDW FROM hz_info JOIN mzjzjlb JOIN jybgb JOIN jyjgzbb JOIN person_info_hz_info JOIN person_info 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.Y...
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
tell me the number of patients who were diagnosed with long-term use of steroids.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.short_title = "Long-term use steroids"
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...
what is drug type of subject id 3343?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.subject_id = "3343"
mimicsql_data
CREATE TABLE table_name_71 ( producer VARCHAR, production_cost VARCHAR )
What is the name of the producer that produced a film with a production cost of $1,000,000?
SELECT producer FROM table_name_71 WHERE production_cost = "$1,000,000"
sql_create_context
CREATE TABLE table_23989 ( "Rd." real, "Race Title" text, "Circuit" text, "Location" text, "Date" text, "Format" text, "Winner" text, "Team" text, "Report" text )
Who was the winner of the race at barbagallo raceway?
SELECT "Winner" FROM table_23989 WHERE "Circuit" = 'Barbagallo Raceway'
wikisql
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...
how many patients whose days of hospital stay is greater than 17 and diagnoses long title is polyneuropathy in diabetes?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "17" AND diagnoses.long_title = "Polyneuropathy in diabetes"
mimicsql_data
CREATE TABLE documents_to_be_destroyed ( document_id number, destruction_authorised_by_employee_id number, destroyed_by_employee_id number, planned_destruction_date time, actual_destruction_date time, other_details text ) CREATE TABLE ref_document_types ( document_type_code text, docume...
What is the location name of the document 'Robin CV'?
SELECT T3.location_name FROM all_documents AS T1 JOIN document_locations AS T2 ON T1.document_id = T2.document_id JOIN ref_locations AS T3 ON T2.location_code = T3.location_code WHERE T1.document_name = "Robin CV"
spider
CREATE TABLE table_name_48 ( country VARCHAR, to_par VARCHAR, player VARCHAR )
What is Country, when To Par is ' 2', and when Player is 'Tsuneyuki Nakajima'?
SELECT country FROM table_name_48 WHERE to_par = "–2" AND player = "tsuneyuki nakajima"
sql_create_context
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...
is the patient kelly gallardo married or unmarried?
SELECT demographic.marital_status FROM demographic WHERE demographic.name = "Kelly Gallardo"
mimicsql_data
CREATE TABLE table_name_63 ( greek VARCHAR, latin VARCHAR )
to the Latin of f, y, u/v/w?
SELECT greek FROM table_name_63 WHERE latin = "f, y, u/v/w"
sql_create_context
CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE branch ( branch_id number, name text, open_year text, address...
What are the names of the members and branches at which they are registered sorted by year of registration?
SELECT T3.name, T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member AS T3 ON T1.member_id = T3.member_id ORDER BY T1.register_year
spider
CREATE TABLE table_name_44 ( elected VARCHAR, assembled VARCHAR )
What Elected has Assembled of 23 january 1559?
SELECT elected FROM table_name_44 WHERE assembled = "23 january 1559"
sql_create_context
CREATE TABLE table_name_50 ( total VARCHAR, to_par VARCHAR )
What is the total number of Total, when To Par is '7'?
SELECT COUNT(total) FROM table_name_50 WHERE to_par = 7
sql_create_context
CREATE TABLE table_2195 ( "Episode" text, "First broadcast" text, "Rufus guest" text, "Marcus guest" text, "Winner" text )
Which episodes have Chris Addison as Rufus's guest?
SELECT "Episode" FROM table_2195 WHERE "Rufus guest" = 'Chris Addison'
wikisql
CREATE TABLE table_name_6 ( year_won INTEGER, finish VARCHAR, country VARCHAR )
Which year won has a Finish of t24, and a Country of england?
SELECT AVG(year_won) FROM table_name_6 WHERE finish = "t24" AND country = "england"
sql_create_context
CREATE TABLE table_name_31 ( date VARCHAR, competition VARCHAR, score VARCHAR )
What was the date of the friendly competition with a score of 4-0?
SELECT date FROM table_name_31 WHERE competition = "friendly" AND score = "4-0"
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, give me the trend about commission_pct over hire_date , could you display X-axis in ascending order?
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY HIRE_DATE
nvbench
CREATE TABLE injury_accident ( game_id VARCHAR, player VARCHAR ) CREATE TABLE game ( season VARCHAR, id VARCHAR )
What is the season of the game which causes the player 'Walter Samuel' to get injured?
SELECT T1.season FROM game AS T1 JOIN injury_accident AS T2 ON T1.id = T2.game_id WHERE T2.player = 'Walter Samuel'
sql_create_context
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescription...
find the name of subject id 3343.
SELECT demographic.name FROM demographic WHERE demographic.subject_id = "3343"
mimicsql_data
CREATE TABLE table_203_509 ( id number, "year" number, "laetare medalist" text, "position" text )
how many laetare medalists were philantrohpists ?
SELECT COUNT("laetare medalist") FROM table_203_509 WHERE "position" = 'philanthropist'
squall
CREATE TABLE table_name_45 ( actor VARCHAR, result VARCHAR, category VARCHAR )
What actor was nominated for best actress?
SELECT actor FROM table_name_45 WHERE result = "nominated" AND category = "best actress"
sql_create_context
CREATE TABLE wine ( no number, grape text, winery text, appelation text, state text, name text, year number, price number, score number, cases number, drink text ) CREATE TABLE grapes ( id number, grape text, color text ) CREATE TABLE appellations ( no numbe...
Find the white grape used to produce wines with scores above 90.
SELECT DISTINCT T1.grape FROM grapes AS T1 JOIN wine AS T2 ON T1.grape = T2.grape WHERE T1.color = "White" AND T2.score > 90
spider
CREATE TABLE table_11907963_6 ( score VARCHAR, high_rebounds VARCHAR )
What was the score for the game in which Emeka Okafor (10) had high rebounds?
SELECT score FROM table_11907963_6 WHERE high_rebounds = "Emeka Okafor (10)"
sql_create_context
CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_time int ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, dire...
i need a reservation from BALTIMORE to SAN FRANCISCO
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 = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN ...
atis
CREATE TABLE table_60690 ( "Place" text, "Player" text, "Country" text, "Score" text, "To Par" real )
Which Country has a Score of 69-74=143?
SELECT "Country" FROM table_60690 WHERE "Score" = '69-74=143'
wikisql
CREATE TABLE table_20739 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text )
What did the home team score against Richmond?
SELECT "Home team score" FROM table_20739 WHERE "Away team" = 'Richmond'
wikisql
CREATE TABLE Songs ( SongId VARCHAR, songid VARCHAR, title VARCHAR ) CREATE TABLE Instruments ( instrument VARCHAR, songid VARCHAR, bandmateid VARCHAR ) CREATE TABLE Band ( id VARCHAR, lastname VARCHAR ) CREATE TABLE Performance ( bandmate VARCHAR, SongId VARCHAR )
What instrument did the musician with last name 'Heilo' use in the song 'Badlands'?
SELECT T4.instrument FROM Performance AS T1 JOIN Band AS T2 ON T1.bandmate = T2.id JOIN Songs AS T3 ON T3.songid = T1.songid JOIN Instruments AS T4 ON T4.songid = T3.songid AND T4.bandmateid = T2.id WHERE T2.lastname = "Heilo" AND T3.title = "Badlands"
sql_create_context
CREATE TABLE table_29780 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many different items appear in the high rebounds column in game 80?
SELECT COUNT("High rebounds") FROM table_29780 WHERE "Game" = '80'
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, find name and code , and group by attribute founder, and visualize them by a bar chart.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name
nvbench
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY...
For those employees who did not have any job in the past, visualize a scatter chart about the correlation between employee_id and department_id .
SELECT EMPLOYEE_ID, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history)
nvbench
CREATE TABLE table_70914 ( "Year" real, "Total Region" real, "Belyando" real, "Broadsound" real, "Nebo" real )
What is the sum of Total Regions that have the Year 1954, and a Nebo greater than 447?
SELECT SUM("Total Region") FROM table_70914 WHERE "Year" = '1954' AND "Nebo" > '447'
wikisql
CREATE TABLE table_name_63 ( nation VARCHAR, bronze VARCHAR )
What nation has 28 bronze medals?
SELECT nation FROM table_name_63 WHERE bronze = "28"
sql_create_context
CREATE TABLE table_13782 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the average number of gold medals won among the nations that won more than 1 bronze?
SELECT AVG("Gold") FROM table_13782 WHERE "Bronze" > '1'
wikisql
CREATE TABLE game ( stadium_id int, id int, Season int, Date text, Home_team text, Away_team text, Score text, Competition text ) CREATE TABLE injury_accident ( game_id int, id int, Player text, Injury text, Number_of_matches text, Source text ) CREATE TABLE sta...
List the number of games in each season with a line chart, sort from high to low by the X.
SELECT Season, COUNT(Season) FROM game GROUP BY Season ORDER BY Season DESC
nvbench
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 female patients used the drug code metl25?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "F" AND prescriptions.formulary_drug_cd = "METL25"
mimicsql_data
CREATE TABLE table_33500 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was the away team's score for the match played at Victoria Park?
SELECT "Away team score" FROM table_33500 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE loan ( loan_ID varchar(3), loan_type varchar(15), cust_ID varchar(3), branch_ID varchar(3), amount int ) CREATE TABLE customer ( cust_ID varchar(3), cust_name varchar(20), acc_type char(1), acc_bal int, no_of_loans int, credit_score int, branch_ID int, s...
Return a histogram on what are the different names and credit scores of customers who have taken a loan?, show Y from low to high order please.
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY credit_score
nvbench
CREATE TABLE table_203_812 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who ranked right after turkey ?
SELECT "nation" FROM table_203_812 WHERE "rank" = (SELECT "rank" FROM table_203_812 WHERE "nation" = 'turkey') + 1
squall
CREATE TABLE table_72721 ( "Week #" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
Name the week number for andrew lloyd webber
SELECT "Week #" FROM table_72721 WHERE "Theme" = 'Andrew Lloyd Webber'
wikisql
CREATE TABLE table_name_32 ( object_type VARCHAR, declination___j2000__ VARCHAR, constellation VARCHAR, ngc_number VARCHAR )
Which Object type has a Constellation of orion, and an NGC number larger than 2174, and a Declination (J2000) of 48 06 ?
SELECT object_type FROM table_name_32 WHERE constellation = "orion" AND ngc_number > 2174 AND declination___j2000__ = "°48′06″"
sql_create_context
CREATE TABLE table_name_69 ( round_3 VARCHAR, round_4 VARCHAR )
Round 3 with less than 54 for Round 4?
SELECT round_3 FROM table_name_69 WHERE round_4 = "54"
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, ...
38758660的患者之前会有哪些不良反应
SELECT * FROM hz_info JOIN mzjzjlb JOIN jyjgzbb ON hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE hz_info.RYBH = '38758660' AND jyjgzbb.JCZBJGDL < jyjgzbb.CKZFWXX OR jyjgzbb...
css
CREATE TABLE table_name_50 ( lane INTEGER, mark VARCHAR )
What was the lowest lane with a mark of 7.26?
SELECT MIN(lane) FROM table_name_50 WHERE mark = "7.26"
sql_create_context
CREATE TABLE table_204_494 ( id number, "episode #" text, "original air date (uk)" text, "episode title" text, "guest cast" text, "dvd # 1" number )
which episode was previous to target
SELECT "episode title" FROM table_204_494 WHERE id = (SELECT id FROM table_204_494 WHERE "episode title" = '"target"') - 1
squall
CREATE TABLE table_name_84 ( score VARCHAR, game VARCHAR )
What was the score of game 4?
SELECT score FROM table_name_84 WHERE game = 4
sql_create_context
CREATE TABLE table_15405904_1 ( points INTEGER, position VARCHAR )
How many points are listed when the position is 2?
SELECT MAX(points) FROM table_15405904_1 WHERE position = 2
sql_create_context
CREATE TABLE table_name_22 ( game INTEGER, opponent VARCHAR )
Which Game has an Opponent of @ houston rockets?
SELECT MIN(game) FROM table_name_22 WHERE opponent = "@ houston rockets"
sql_create_context
CREATE TABLE routes ( rid number, dst_apid number, dst_ap text, src_apid number, src_ap text, alid number, airline text, codeshare text ) CREATE TABLE airports ( apid number, name text, city text, country text, x number, y number, elevation number, iata t...
What is the name of the airport with the most number of routes that start in China?
SELECT T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid WHERE T1.country = 'China' GROUP BY T1.name ORDER BY COUNT(*) DESC LIMIT 1
spider
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
how many patients whose age is less than 59 and drug code is tacrsusp?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "59" AND prescriptions.formulary_drug_cd = "TACRSUSP"
mimicsql_data
CREATE TABLE table_44876 ( "Rank" real, "Surname" text, "Number of bearers 1971" real, "Number of bearers 2009" real, "Type" text, "Etymology" text )
What is the sum of number of bearers in 2009 for a rank above 1, a type of patronymic, an etymology meaning son of Christian, and the number of bearers in 1971 greater than 45.984?
SELECT SUM("Number of bearers 2009") FROM table_44876 WHERE "Rank" > '1' AND "Type" = 'patronymic' AND "Etymology" = 'son of christian' AND "Number of bearers 1971" > '45.984'
wikisql
CREATE TABLE table_51245 ( "Round" real, "Nominees" text, "Team" text, "Match" text, "Ground" text )
what round saw the ground of telstra dome and shaun burgoyne as nominees?
SELECT MAX("Round") FROM table_51245 WHERE "Ground" = 'telstra dome' AND "Nominees" = 'shaun burgoyne'
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 icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit...
what was the name of a drug patient 65124 was last prescribed on the last hospital encounter?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 65124 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1) ORDER BY prescriptions.startdate DESC LIMIT 1
mimic_iii
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 Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm_amenity ( ameni...
What is the average age for each city and what are those cities Show bar chart, and list names in descending order.
SELECT city_code, AVG(Age) FROM Student GROUP BY city_code ORDER BY city_code DESC
nvbench
CREATE TABLE table_69451 ( "Tournament" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text, "2007" text, "2008" text, "2009" text, "2010" text, "2011" text, "2012" text )
Name the 2011 with 2006 of 2r
SELECT "2011" FROM table_69451 WHERE "2006" = '2r'
wikisql
CREATE TABLE table_33121 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
Which week with Green Bay Packers as an opponent is the highest?
SELECT MAX("Week") FROM table_33121 WHERE "Opponent" = 'green bay packers'
wikisql
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
Group and count brand for each camera lens using a bar chart.
SELECT brand, COUNT(brand) FROM camera_lens GROUP BY brand
nvbench
CREATE TABLE table_71322 ( "School" text, "Location" text, "Total" real, "Crimean War" real, "Persian War" real, "Indian Mutiny" real, "1860-1878" real, "Zulu War" real, "Second Afghan War" text )
Which school has an 1860-1878 larger than 0, and a Second Afghan War of 0?
SELECT "School" FROM table_71322 WHERE "1860-1878" > '0' AND "Second Afghan War" = '0'
wikisql
CREATE TABLE mzjybgb ( BBCJBW text, BBDM text, BBMC text, BBZT number, BGDH number, 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, ...
编号为28349097的病患的检验报告单的报告日期在15年4月17日之后的是哪些住院就诊的?列出流水号
SELECT zyjzjlb.JZLSH 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 = '28349097' AND NOT zyjzjlb.JZLSH IN (SELECT zyjybgb.JZLSH FROM zyjybgb WHERE zyjybgb.BGRQ <= '2015-04-17' UNION SELECT mzjybgb.JZLSH FROM mzjybgb WHERE mzjybgb...
css
CREATE TABLE table_name_25 ( score VARCHAR, outcome VARCHAR, date VARCHAR )
What is the score when the outcome was runner-up, earlier than 1975?
SELECT score FROM table_name_25 WHERE outcome = "runner-up" AND date < 1975
sql_create_context
CREATE TABLE table_79237 ( "Name" text, "Height" text, "Weight" text, "Spike" text, "2008 club" text )
What is the name for the 2008 club of Azs olsztyn?
SELECT "Name" FROM table_79237 WHERE "2008 club" = 'azs olsztyn'
wikisql
CREATE TABLE PROFESSOR ( EMP_NUM int, DEPT_CODE varchar(10), PROF_OFFICE varchar(50), PROF_EXTENSION varchar(4), PROF_HIGH_DEGREE varchar(5) ) CREATE TABLE COURSE ( CRS_CODE varchar(10), DEPT_CODE varchar(10), CRS_DESCRIPTION varchar(35), CRS_CREDIT float(8) ) CREATE TABLE DEPARTME...
How many sections does each course have Visualize by bar chart, and list by the the total number from low to high.
SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*)
nvbench
CREATE TABLE table_20535 ( "#" real, "Air Date" text, "Timeslot" text, "Rating" text, "Share" real, "18-49" text, "Viewers" text, "Weekly Rank" text )
What are the timeslot(s) for broadcast on February 22, 2008?
SELECT "Timeslot" FROM table_20535 WHERE "Air Date" = 'February 22, 2008'
wikisql
CREATE TABLE gsi ( course_offering_id int, student_id int ) 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, tough_tests int, ...
Over the next 6 semesters , what classes will be offered ?
SELECT DISTINCT course.name, course.number, semester.semester, semester.year FROM course, course_offering, semester WHERE ((semester.semester = 'FA' AND semester.year = 2016) OR (semester.semester = 'FA' AND semester.year = 2017) OR (semester.semester = 'FA' AND semester.year = 2018) OR (semester.semester = 'WN' AND se...
advising
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, what is the relationship between manufacturer and code , and group by attribute name?
SELECT T1.Manufacturer, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the average of department_id over the hire_date bin hire_date by time by a bar chart, and list mean department id from high to low order.
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY AVG(DEPARTMENT_ID) DESC
nvbench
CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH text, KH text, KLX number, MZBMLX number, MZJZLSH text, MZZDBM text, MZZDMC text, MZZYZDZZBM...
姓名是吕经艺的患者的哪些检验报告单上的检验结论指标都正常的?具体的检验报告单号是啥?
SELECT jyjgzbb.BGDH FROM person_info JOIN hz_info JOIN mzjzjlb JOIN jyjgzbb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND mzjzjlb.YLJGDM = jyjgzbb.jybgb_YLJGDM_MZJZJLB AND mzjzjlb.JZLSH = jyjgzbb.jybgb_JZLSH_MZJZJLB WHERE person_info...
css
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 labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, ...
what is the organism name found until 20 months ago in the last isolate microbiology test of patient 95470?
SELECT microbiologyevents.org_name FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 95470) AND microbiologyevents.spec_type_desc = 'isolate' AND NOT microbiologyevents.org_name IS NULL AND DATETIME(microbiologyevents.charttime) <= DATET...
mimic_iii
CREATE TABLE table_204_423 ( id number, "name" text, "location" text, "city" text, "listing date" text )
which city has the largest number of historic sites ?
SELECT "city" FROM table_204_423 GROUP BY "city" ORDER BY COUNT("name") DESC LIMIT 1
squall
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 text, ZYLBDM text, ZYMC text ) CREATE TABLE zyjzjlb ( CYBQDM text, CYBQMC...
审核人的工号以及姓名在检验结果指标记录40478366536是什么?
SELECT jyjgzbb.SHRGH, jyjgzbb.SHRXM FROM jyjgzbb WHERE jyjgzbb.JYZBLSH = '40478366536'
css
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_course ( program_id int, course_id int, workload int, category varchar ) CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE program_requirement ( program_id int, catego...
May I sign up for 400 -level classes in Fall or Winter term ?
SELECT DISTINCT COURSEalias0.department, COURSEalias0.name, COURSEalias0.number, SEMESTERalias0.semester FROM (SELECT course_id FROM student_record WHERE earn_credit = 'Y' AND student_id = 1) AS DERIVED_TABLEalias0, course AS COURSEalias0, course_offering AS COURSE_OFFERINGalias0, semester AS SEMESTERalias0 WHERE ((SEM...
advising
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE restriction ( restriction_code text, advance_purchase int, stopovers text, saturday_stay_required text, minimum_stay int, maximum_stay int, application text, no_discounts text ) CREATE TAB...
show me the flights from DENVER to LAS VEGAS
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 = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'LAS VEG...
atis
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) 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 t...
how many patients tested for rbc pleural in lab?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "RBC, Pleural"
mimicsql_data
CREATE TABLE table_dev_33 ( "id" int, "gender" string, "fpg" float, "active_infection" bool, "uncontrolled_diabetes" bool, "hiv_infection" bool, "hemoglobin_a1c_hba1c" float, "urine_albumin_excretion" int, "hematocrit_hct" float, "fasting_plasma_glucose" int, "dietary_modific...
bmi: 18 _ 25 kg / m2 hba1c: < 8.9 % fasting plasma glucose: < 250 mg / dl other inclusion criteria: on dietary modification and / or metformin
SELECT * FROM table_dev_33 WHERE (body_mass_index_bmi >= 18 AND body_mass_index_bmi <= 25) OR hemoglobin_a1c_hba1c < 8.9 OR fasting_plasma_glucose < 250 OR (dietary_modification = 1 OR metformin = 1)
criteria2sql
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, ...
小儿口腔颌面外科在03年1月26日至12年9月17日这段时间的住院总量有多少
SELECT COUNT(*) FROM zyjzjlb WHERE zyjzjlb.JZKSMC = '小儿口腔颌面外科' AND zyjzjlb.RYDJSJ BETWEEN '2003-01-26' AND '2012-09-17'
css
CREATE TABLE table_name_13 ( place VARCHAR, to_par VARCHAR, player VARCHAR )
With a To par of 2, what is Johnny Miller's Place?
SELECT place FROM table_name_13 WHERE to_par = "–2" AND player = "johnny miller"
sql_create_context
CREATE TABLE table_256286_8 ( no_votes VARCHAR, description VARCHAR )
How many data are there under NO vote with a description of $1500 tax exemption amendment?
SELECT COUNT(no_votes) FROM table_256286_8 WHERE description = "$1500 Tax Exemption Amendment"
sql_create_context
CREATE TABLE table_54308 ( "Date" text, "Score" text, "Set 1" text, "Set 2" text, "Set 3" text, "Total" text )
What is the Set 2 with a Total with 45 12?
SELECT "Set 2" FROM table_54308 WHERE "Total" = '45–12'
wikisql
CREATE TABLE body_builder ( Body_Builder_ID int, People_ID int, Snatch real, Clean_Jerk real, Total real ) CREATE TABLE people ( People_ID int, Name text, Height real, Weight real, Birth_Date text, Birth_Place text )
List the snatch score and clean jerk score of body builders in ascending order of snatch score. Plot them as scatter chart.
SELECT Snatch, Clean_Jerk FROM body_builder
nvbench
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 diagnosis ( diagnosisid number...
what were the five most common intakes?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 5
eicu
CREATE TABLE table_35652 ( "Games" real, "Drawn" real, "Lost" real, "Points difference" text, "Points" real )
What game is the lowest with 1 draw and less than 7 points?
SELECT MIN("Games") FROM table_35652 WHERE "Drawn" = '1' AND "Points" < '7'
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, return a bar chart about the distribution of name and manufacturer , and group by attribute founder, I want to rank by the y-axis in descending.
SELECT T1.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Manufacturer DESC
nvbench
CREATE TABLE table_78098 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the number of bronze that Scotland, which has less than 7 total medals, has?
SELECT SUM("Bronze") FROM table_78098 WHERE "Nation" = 'scotland' AND "Total" < '7'
wikisql
CREATE TABLE Addresses ( Address_ID VARCHAR(100), Line_1 VARCHAR(255), Line_2 VARCHAR(255), City_Town VARCHAR(255), State_County VARCHAR(255), Other_Details VARCHAR(255) ) CREATE TABLE Stores ( Store_ID VARCHAR(100), Address_ID INTEGER, Marketing_Region_Code CHAR(15), Store_Name...
Find the number of the order dates of the orders with price above 1000.
SELECT Order_Date, COUNT(Order_Date) FROM Customer_Orders AS T1 JOIN Order_Items AS T2 ON T1.Order_ID = T2.Order_ID JOIN Products AS T3 ON T2.Product_ID = T3.Product_ID WHERE T3.Product_Price > 1000
nvbench
CREATE TABLE table_32481 ( "Week" text, "Opponent" text, "Result" text, "Stadium" text, "Record" text, "Attendance" text )
Who won when the Patriots played the Denver Broncos?
SELECT "Record" FROM table_32481 WHERE "Opponent" = 'denver broncos'
wikisql
CREATE TABLE table_name_81 ( year INTEGER, venue VARCHAR )
What's the average of all years tournaments were hosted in Doha, Qatar?
SELECT AVG(year) FROM table_name_81 WHERE venue = "doha, qatar"
sql_create_context
CREATE TABLE table_27371 ( "Pick #" real, "NFL Team" text, "Player" text, "Position" text, "College" text )
Name the most pick number for illinois
SELECT MAX("Pick #") FROM table_27371 WHERE "College" = 'Illinois'
wikisql
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ...
how many patients have undergone a vascular catheter placement - central venous two or more times since 2 years ago?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, COUNT(*) AS c1 FROM patient WHERE patient.patientunitstayid = (SELECT treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'vascular catheter placement - central venous' AND DATETIME(treatment.treatmenttime) >= DATETIME(CURRENT_TI...
eicu
CREATE TABLE table_name_18 ( results VARCHAR, first_elected VARCHAR, district VARCHAR )
What was the result of the Oregon 5 District incumbent who was first elected in 1996?
SELECT results FROM table_name_18 WHERE first_elected = 1996 AND district = "oregon 5"
sql_create_context
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 ( ...
calculate the maximum age of female divorced patients.
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.gender = "F"
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 diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) C...
what is the drug code and drug route of the drug calcium carbonate?
SELECT prescriptions.formulary_drug_cd, prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Calcium Carbonate"
mimicsql_data
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE PostHistory ( Id number, PostHistoryT...
Game Tag question by Weeks since release.
SELECT COUNT(*), CONCAT_WS('_', TIME_TO_STR('creationdate', '%Year'), TIME_TO_STR('creationdate', 'Week')) AS "weekyear" FROM Posts WHERE Tags LIKE '%dark-souls-3%' GROUP BY CONCAT_WS('_', TIME_TO_STR('creationdate', '%Year'), TIME_TO_STR('creationdate', 'Week'))
sede
CREATE TABLE table_66573 ( "State and District of Columbia" text, "Obese adults" text, "Overweight (incl. obese) adults" text, "Obese children and adolescents" text, "Obesity rank" real )
What's the rank in West Virginia when the overweight adult was 66.8%?
SELECT "Obesity rank" FROM table_66573 WHERE "Overweight (incl. obese) adults" = '66.8%' AND "State and District of Columbia" = 'west virginia'
wikisql
CREATE TABLE table_3837 ( "Season" text, "Overall Record" text, "SEC Record" text, "Overall Attendance" real, "Average Attendance" real, "Rank Nationally" text )
What is the overall attendance in the places where the average attendance was 17148?
SELECT "Overall Attendance" FROM table_3837 WHERE "Average Attendance" = '17148'
wikisql
CREATE TABLE table_31468 ( "Rank" real, "Rider" text, "Sat 20 Aug" text, "Mon 22 Aug" text, "Tues 23 Aug" text, "Wed 24 Aug" text, "Thurs 25 Aug" text, "Fri 26 Aug" text )
What shows for thurs 25 aug when fri 26 aug is 19' 30.70 116.023mph?
SELECT "Thurs 25 Aug" FROM table_31468 WHERE "Fri 26 Aug" = '19'' 30.70 116.023mph'
wikisql
CREATE TABLE table_name_25 ( school_club_team VARCHAR, player VARCHAR )
What team does Kenny Smith play for?
SELECT school_club_team FROM table_name_25 WHERE player = "kenny smith"
sql_create_context
CREATE TABLE table_42159 ( "Team #1" text, "Agg." text, "Team #2" text, "1st leg" text, "2nd leg" text )
Which 1st leg has a Team #1 of ummc ekaterinburg?
SELECT "1st leg" FROM table_42159 WHERE "Team #1" = 'ummc ekaterinburg'
wikisql
CREATE TABLE people ( people_id number, age number, name text, nationality text, graduation_college text ) CREATE TABLE employment ( company_id number, people_id number, year_working number ) CREATE TABLE company ( company_id number, name text, headquarters text, indust...
How many companies are headquartered in the US?
SELECT COUNT(*) FROM company WHERE headquarters = 'USA'
spider