context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsystolic number, systemicdiastolic number, systemicmean number, observationtime time ) CREATE TABLE patient ( uniquep...
until 02/2105 has morphine, ondansetron or vancomycin consult to pharmacy been prescribed for patient 029-22492?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '029-22492')) AND medication.drugname IN ('morphine', 'ondansetron', 'vanco...
eicu
CREATE TABLE Student ( major VARCHAR, age INTEGER )
Show the average, minimum, and maximum age for different majors.
SELECT major, AVG(age), MIN(age), MAX(age) FROM Student GROUP BY major
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...
How many patients admitted before the year 2135 had urinary incontinence (unspecified)?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2135" AND diagnoses.long_title = "Urinary incontinence, unspecified"
mimicsql_data
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, ...
give me the amount of output until 12/21/2105 for patient 012-29464.
SELECT SUM(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-29464')) AND intakeoutput.cellpath LIKE '%ou...
eicu
CREATE TABLE table_46760 ( "Team 1" text, "Agg." text, "Team 2" text, "1st leg" text, "2nd leg" text )
What is the team 1 in the match with a team 2 of Karabakh?
SELECT "Team 1" FROM table_46760 WHERE "Team 2" = 'karabakh'
wikisql
CREATE TABLE table_30441 ( "Stadium" text, "Capacity" real, "City" text, "Country" text, "Tenant" text, "Opening" text )
Name the country for lusail national stadium
SELECT "Country" FROM table_30441 WHERE "Stadium" = 'Lusail National Stadium'
wikisql
CREATE TABLE table_56752 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What home team did South Melbourne play as the away team?
SELECT "Home team" FROM table_56752 WHERE "Away team" = 'south melbourne'
wikisql
CREATE TABLE table_23186738_10 ( high_rebounds VARCHAR, record VARCHAR )
Who had the highest rebounds in the game where the record was 27-54?
SELECT high_rebounds FROM table_23186738_10 WHERE record = "27-54"
sql_create_context
CREATE TABLE view_unit_status ( apt_id number, apt_booking_id number, status_date time, available_yn others ) CREATE TABLE apartment_buildings ( building_id number, building_short_name text, building_full_name text, building_description text, building_address text, building_mana...
What is the average number of bedrooms of all apartments?
SELECT AVG(bedroom_count) FROM apartments
spider
CREATE TABLE products ( product_id number, color_code text, product_category_code text, product_name text, typical_buying_price text, typical_selling_price text, product_description text, other_product_details text ) CREATE TABLE characteristics ( characteristic_id number, chara...
What are the name and typical buying and selling prices of the products that have color described as 'yellow'?
SELECT t1.product_name, t1.typical_buying_price, t1.typical_selling_price FROM products AS t1 JOIN ref_colors AS t2 ON t1.color_code = t2.color_code WHERE t2.color_description = "yellow"
spider
CREATE TABLE table_53590 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the time/retired associated with a grid of 5 and under 73 laps?
SELECT "Time/Retired" FROM table_53590 WHERE "Laps" < '73' AND "Grid" = '5'
wikisql
CREATE TABLE table_44983 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real )
Which Diameter (km) has a Name of alma-merghen planitia, and a Year named smaller than 1997?
SELECT MAX("Diameter (km)") FROM table_44983 WHERE "Name" = 'alma-merghen planitia' AND "Year named" < '1997'
wikisql
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE city ( city_code varchar, city_name varchar, state_code varchar, country_name varchar, time_zone_code varchar ) CREATE TABLE flight_stop ( flight_id int, stop_number int, stop_days text...
i would like to know the flights available from BOSTON to DENVER arriving in DENVER by 800 o'clock wednesday morning
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 (((((flight.arrival_time < flight.departure_time) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.da...
atis
CREATE TABLE table_name_37 ( silver INTEGER, rank INTEGER )
How many Silver medals did the Nation with a Rank of less than 1 receive?
SELECT AVG(silver) FROM table_name_37 WHERE rank < 1
sql_create_context
CREATE TABLE table_name_17 ( director VARCHAR, episode VARCHAR )
Which Director has an Episode of 13?
SELECT director FROM table_name_17 WHERE episode = 13
sql_create_context
CREATE TABLE table_43727 ( "Stage" real, "Start" text, "Arrival" text, "Duration" text, "Difficulty" text )
Which stage number did son bou arrive at?
SELECT COUNT("Stage") FROM table_43727 WHERE "Arrival" = 'son bou'
wikisql
CREATE TABLE table_name_49 ( crowd INTEGER, venue VARCHAR )
What was the crowd when the VFL played Windy Hill?
SELECT SUM(crowd) FROM table_name_49 WHERE venue = "windy hill"
sql_create_context
CREATE TABLE airline ( airline_code varchar, airline_name text, note text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
flights from DALLAS to HOUSTON in the morning
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 = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'HOUSTO...
atis
CREATE TABLE table_60773 ( "Date" text, "Nationality / Opponent" text, "Ground" text, "Result" text, "Competition" text )
Name Nationality / Opponent on 10 january 1998?
SELECT "Nationality / Opponent" FROM table_60773 WHERE "Date" = '10 january 1998'
wikisql
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 boolean, Predefined boolean, PostNoticeDurationId number...
Users with one or more [identification] questions.
SELECT DISTINCT OwnerUserId AS "user_id", OwnerUserId AS "user_link", COUNT(OwnerUserId) AS "qcount" FROM Posts INNER JOIN PostTags ON Posts.Id = PostTags.PostId WHERE PostTypeId = 1 AND CommunityOwnedDate IS NULL AND ClosedDate IS NULL AND PostTags.TagId = @tagid GROUP BY OwnerUserId HAVING COUNT(OwnerUserId) > 0 ORDE...
sede
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
tag badges for a user.
SELECT b.Name, b.Date, b.Class FROM Badges AS b WHERE b.TagBased = 'true' AND b.UserId = '##UserId##'
sede
CREATE TABLE channel ( Channel_ID int, Name text, Owner text, Share_in_percent real, Rating_in_percent real ) CREATE TABLE broadcast ( Channel_ID int, Program_ID int, Time_of_day text ) CREATE TABLE broadcast_share ( Channel_ID int, Program_ID int, Date text, Share_in_p...
A bar chart about what is the total rating of channel for each channel owner?, and rank X from high to low order.
SELECT Owner, SUM(Rating_in_percent) FROM channel GROUP BY Owner ORDER BY Owner DESC
nvbench
CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, DeletionDate time, Score number, ViewCount number, ...
CLEANUP: Find new tag wikis.
SELECT Tags.TagName, Posts.Body, Posts.CreationDate FROM Posts INNER JOIN Tags ON Posts.Id = Tags.WikiPostId WHERE Posts.PostTypeId IN (5) AND DATEADD(MONTH, 1, Posts.CreationDate) >= GETDATE() AND Posts.Body != '' ORDER BY Posts.CreationDate DESC
sede
CREATE TABLE table_44618 ( "Event" text, "Date" text, "Round" text, "Name" text, "Nationality" text, "Time" text, "Record" text )
What is the record for the date of 12 december?
SELECT "Record" FROM table_44618 WHERE "Date" = '12 december'
wikisql
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) CREATE TABLE bdmzjzjlb ( CYBQDM text, CYBQMC text, CYCWH text, CYKSDM text, CYKSMC text, CYSJ time, CYZTDM number, HZXM text, JZKSDM text, JZKSMC text, JZLSH number, KH text, KLX num...
名叫李宇航的患者以前都有哪些住院诊断还记得吗?
SELECT wdmzjzjlb.ZYZDBM, wdmzjzjlb.ZYZDMC FROM person_info JOIN hz_info JOIN wdmzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = wdmzjzjlb.YLJGDM AND hz_info.KH = wdmzjzjlb.KH AND hz_info.KLX = wdmzjzjlb.KLX WHERE person_info.XM = '李宇航' UNION SELECT bdmzjzjlb.ZYZDBM, bdmzjzjlb.ZYZDMC FROM person_info JOIN...
css
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
what number of patients had the drug code calc25?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.formulary_drug_cd = "CALC25"
mimicsql_data
CREATE TABLE film_market_estimation ( Estimation_ID int, Low_Estimate real, High_Estimate real, Film_ID int, Type text, Market_ID int, Year int ) CREATE TABLE film ( Film_ID int, Title text, Studio text, Director text, Gross_in_dollar int ) CREATE TABLE market ( Mar...
Use a stacked bar chart to show how many films for each title and each type The x-axis is title, I want to display from high to low by the Y.
SELECT Title, COUNT(Title) FROM film AS T1 JOIN film_market_estimation AS T2 ON T1.Film_ID = T2.Film_ID GROUP BY Type, Title ORDER BY COUNT(Title) DESC
nvbench
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text,...
Find question in the past month that have links to JSFiddle or CodePen but no code in the question.
SELECT CONCAT('http://stackoverflow.com/questions/', Id) AS "Link", Score FROM Posts WHERE CreationDate > DATEADD(MONTH, -1, GETDATE()) AND PostTypeId = 1 AND (Body LIKE '%jsfiddle.net%' OR Body LIKE '%codepen.io%') AND NOT (Body LIKE '% %' OR Body LIKE '%<pre>%' OR Body LIKE '%<code>%')
sede
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...
列一下患者水沛珊在2298626住院的时候的就诊记录,其中入院时科室名字要不带咨询字样的就诊记录
SELECT * FROM person_info JOIN hz_info JOIN zyjzjlb JOIN hz_info_zyjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info.KH = zyjzjlb.KH AND hz_info.KLX = zyjzjlb.KLX AND hz_info_zyjzjlb.JZLSH = zyjzjlb.JZLSH AND hz_info_zyjzjlb.YLJGDM = hz_info_zyjzjlb.YLJGDM AND hz_info_zyjz...
css
CREATE TABLE table_2004733_2 ( population__2000_ VARCHAR, barangay VARCHAR )
How many people lived in san gabriel in the year 2000?
SELECT COUNT(population__2000_) FROM table_2004733_2 WHERE barangay = "San Gabriel"
sql_create_context
CREATE TABLE table_name_7 ( draws VARCHAR, golden_rivers VARCHAR, losses VARCHAR, wins VARCHAR )
What is the total number of draws for Wakool when there are more than 11 losses and fewer than 4 wins?
SELECT COUNT(draws) FROM table_name_7 WHERE losses > 11 AND wins < 4 AND golden_rivers = "wakool"
sql_create_context
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE student_record ( student_id int, course_id int, semester i...
Is the Spring-Summer the only time that INTMED 460 is offered ?
SELECT COUNT(*) > 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE course.department = 'INTMED' AND course.number = 460 AND semester.semester <> 'Spring-Summer'
advising
CREATE TABLE table_27826 ( "Lighthouse" text, "Location" text, "Province/City" text, "Date First Lit" text, "Tower height in ft (m)" text, "Focal plane in ft (m)" text, "Current Status" text, "Current Condition/ Description" text )
Where tower height in ft (m) is 46ft (14.0m) the focal plane is ft (m).
SELECT "Focal plane in ft (m)" FROM table_27826 WHERE "Tower height in ft (m)" = '46ft (14.0m)'
wikisql
CREATE TABLE table_58014 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
How many people have attended victoria park?
SELECT COUNT("Crowd") FROM table_58014 WHERE "Venue" = 'victoria park'
wikisql
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( ...
what is gender and diagnoses icd9 code of subject id 2560?
SELECT demographic.gender, diagnoses.icd9_code FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id 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 much patient 010-32698 weighs in 02/this year for the first time?
SELECT patient.admissionweight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '010-32698') AND NOT patient.admissionweight IS NULL AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-...
eicu
CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date...
For all employees who have the letters D or S in their first name, show me about the distribution of job_id and the amount of job_id , and group by attribute job_id in a bar chart, sort in asc by the X please.
SELECT JOB_ID, COUNT(JOB_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench
CREATE TABLE table_26250155_1 ( original_artist VARCHAR, theme VARCHAR )
Who was the original artist of the First solo theme?
SELECT original_artist FROM table_26250155_1 WHERE theme = "First Solo"
sql_create_context
CREATE TABLE table_name_31 ( pick VARCHAR, player VARCHAR )
How many picks did Jay Bruchak have?
SELECT COUNT(pick) FROM table_name_31 WHERE player = "jay bruchak"
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...
what is drug type of drug name cyclosporine (sandimmune)?
SELECT prescriptions.drug_type FROM prescriptions WHERE prescriptions.drug = "CycloSPORINE (Sandimmune)"
mimicsql_data
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
list the earliest flights from ATLANTA to DENVER on a 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, days, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DENVER' AND days.day_name = 'MONDAY' AND flight.flight_days = days.days_code AND f...
atis
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 ) ...
let me know the number of patients less than 83 years who stayed in hospital for more than 6 days.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.age < "83" AND demographic.days_stay > "6"
mimicsql_data
CREATE TABLE table_5990 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Bronze smaller than 5, and a Silver larger than 0 is which nation?
SELECT "Nation" FROM table_5990 WHERE "Bronze" < '5' AND "Silver" > '0'
wikisql
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE CloseReasonTypes ( Id number, Name text, Description t...
Top tags for a given week..
SELECT t.TagName, YEAR(p.CreationDate) AS yr, TIME_TO_STR(p.CreationDate, '%W') AS week, COUNT(p.Id) AS k FROM Posts AS p INNER JOIN PostTags AS pt ON p.Id = pt.PostId INNER JOIN Tags AS t ON pt.TagId = t.Id GROUP BY t.TagName, YEAR(p.CreationDate), TIME_TO_STR(p.CreationDate, '%W') ORDER BY COUNT(p.Id) DESC LIMIT 100
sede
CREATE TABLE table_42962 ( "Year" real, "Result" real, "World Rank" text, "Location" text, "Date" text )
Which Year has a Result smaller than 20.26, and a Location of eugene?
SELECT SUM("Year") FROM table_42962 WHERE "Result" < '20.26' AND "Location" = 'eugene'
wikisql
CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE election ( election_id number, counties_represented text, district number, delegate text, party number, first_elected number, committee text ) CREATE TABLE party ( ...
Show the name of each party and the corresponding number of delegates from that party.
SELECT T2.party, COUNT(*) FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id GROUP BY T1.party
spider
CREATE TABLE table_name_39 ( score VARCHAR, surface VARCHAR, date VARCHAR )
Which score has a Surface of hardcourt, and a Date of september 30, 1984?
SELECT score FROM table_name_39 WHERE surface = "hardcourt" AND date = "september 30, 1984"
sql_create_context
CREATE TABLE table_3934 ( "Round" real, "Race" text, "Pole position" text, "Fastest lap" text, "Most laps led" text, "Driver" text, "Team" text, "Manufacturer" text, "Report" text )
Who had the pole position in Milwaukee?
SELECT "Pole position" FROM table_3934 WHERE "Race" = 'Milwaukee'
wikisql
CREATE TABLE t_kc21_t_kc22 ( MED_CLINIC_ID text, MED_EXP_DET_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 ...
在2015年1月10日到2016年9月10日内医疗机构4663039给患者31775724做了共有多少次检查?
SELECT COUNT(*) FROM t_kc21 JOIN t_kc22 JOIN t_kc21_t_kc22 ON t_kc21.MED_CLINIC_ID = t_kc21_t_kc22.MED_CLINIC_ID AND t_kc21_t_kc22.MED_EXP_DET_ID = t_kc22.MED_EXP_DET_ID WHERE t_kc21.PERSON_ID = '31775724' AND t_kc22.STA_DATE BETWEEN '2015-01-10' AND '2016-09-10' AND t_kc21.MED_SER_ORG_NO = '4663039' AND t_kc22.MED_INV...
css
CREATE TABLE table_26202788_7 ( championship VARCHAR, date VARCHAR )
How many championships are there on the date January 9, 2005?
SELECT COUNT(championship) FROM table_26202788_7 WHERE date = "January 9, 2005"
sql_create_context
CREATE TABLE table_name_17 ( reg_gp INTEGER, player VARCHAR, rd__number VARCHAR )
What is the sum of the number of regular games played by Morgan Clark with the number of road games less than 7?
SELECT SUM(reg_gp) FROM table_name_17 WHERE player = "morgan clark" AND rd__number < 7
sql_create_context
CREATE TABLE table_60027 ( "Rank" text, "Bank" text, "Assets (USD) Millions" real, "Market Share" text, "Number of Branches" real )
What is the highest Assets (USD) Millions from Equity Bank and less than 44 branches?
SELECT MAX("Assets (USD) Millions") FROM table_60027 WHERE "Bank" = 'equity bank' AND "Number of Branches" < '44'
wikisql
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...
show me the flights from ATLANTA to WASHINGTON on wednesday night and thursday morning
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 ((((flight.departure_time <= 2359 AND flight.departure_time >= 1800) AND date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year...
atis
CREATE TABLE table_76809 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which country has is Len Mattiace in T10 place?
SELECT "Country" FROM table_76809 WHERE "Place" = 't10' AND "Player" = 'len mattiace'
wikisql
CREATE TABLE table_20888 ( "Archbishop" text, "Born" text, "Ordained Priest" text, "Ordained Bishop" text, "Appointed Archbishop" text, "Vacated throne" text, "Died" text )
Which archbishop was ordained as bishop November 30, 1925?
SELECT "Archbishop" FROM table_20888 WHERE "Ordained Bishop" = 'November 30, 1925'
wikisql
CREATE TABLE table_name_66 ( constructor VARCHAR, grid VARCHAR, driver VARCHAR )
who is the constructor when the grid is more than 23 and the driver is piercarlo ghinzani?
SELECT constructor FROM table_name_66 WHERE grid > 23 AND driver = "piercarlo ghinzani"
sql_create_context
CREATE TABLE table_name_78 ( final VARCHAR, athlete VARCHAR )
What was the final for rouhollah hosseini?
SELECT final FROM table_name_78 WHERE athlete = "rouhollah hosseini"
sql_create_context
CREATE TABLE table_53936 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On what date was Hawthorn the home team?
SELECT "Date" FROM table_53936 WHERE "Home team" = 'hawthorn'
wikisql
CREATE TABLE table_78272 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
On which date was Essendon the home team?
SELECT "Date" FROM table_78272 WHERE "Home team" = 'essendon'
wikisql
CREATE TABLE table_name_68 ( location VARCHAR, champion VARCHAR )
What location did Anke Huber win the championship?
SELECT location FROM table_name_68 WHERE champion = "anke huber"
sql_create_context
CREATE TABLE table_22812 ( "Year" real, "Starts" real, "Wins" real, "Top 5" real, "Top 10" real, "Poles" real, "Avg. Start" text, "Avg. Finish" text, "Winnings" text, "Position" text, "Team(s)" text )
In what year did the #14 FitzBradshaw Racing compete?
SELECT "Year" FROM table_22812 WHERE "Team(s)" = '#14 FitzBradshaw Racing'
wikisql
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
How many answers I posted by Year.
SELECT YEAR(a.CreationDate) AS "year", MONTH(a.CreationDate) AS "month", COUNT(*) AS "number_of_answers" FROM Posts AS a INNER JOIN Users ON Users.Id = a.OwnerUserId WHERE a.OwnerUserId = @UserId GROUP BY YEAR(a.CreationDate), MONTH(a.CreationDate) ORDER BY YEAR(a.CreationDate) DESC, MONTH(a.CreationDate) DESC
sede
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the number of patients whose religion is jehovah's witness and lab test name is lactate?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.religion = "JEHOVAH'S WITNESS" AND lab.label = "Lactate"
mimicsql_data
CREATE TABLE table_name_54 ( venue VARCHAR, runner_up VARCHAR )
What is the venue where john zibnack was the runner-up?
SELECT venue FROM table_name_54 WHERE runner_up = "john zibnack"
sql_create_context
CREATE TABLE table_59041 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Game site" text, "Record" text, "Attendance" text )
What Date was the Game at Griffith Stadium?
SELECT "Date" FROM table_59041 WHERE "Game site" = 'griffith stadium'
wikisql
CREATE TABLE mzb ( 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...
将病患陶晴画医疗费总额不在769.78元以下的医疗记录中的入院诊断疾病名列出来,还有对应的编号
SELECT qtb.OUT_DIAG_DIS_CD, qtb.OUT_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 >= 769.78) UNION SELECT gyb.OUT_DIAG_DIS_CD, gyb.OUT_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '陶晴画' AND gyb.MED_CLINIC_ID IN (SELECT t_kc24.MED_...
css
CREATE TABLE jybgb ( YLJGDM text, YLJGDM_MZJZJLB text, YLJGDM_ZYJZJLB text, BGDH text, BGRQ time, JYLX number, JZLSH text, JZLSH_MZJZJLB text, JZLSH_ZYJZJLB text, JZLX number, KSBM text, KSMC text, SQRGH text, SQRXM text, BGRGH text, BGRXM text, SHRGH ...
找出医院5086789开出的检验报告单上的日期为13年2月9号到15年6月7号的,把不一样的检测指标名称和不一样的检测指标结果定量单位选出来,把检测指标结果定量平均后的最大的12项都多少?
SELECT JCZBMC, JCZBJGDW, AVG(JCZBJGDL) FROM jyjgzbb WHERE YLJGDM = '5086789' AND BGRQ BETWEEN '2013-02-09' AND '2015-06-07' GROUP BY JCZBMC, JCZBJGDW ORDER BY AVG(JCZBJGDL) DESC LIMIT 12
css
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, ...
is the heart rate value of patient 3369 measured at 2101-01-27 22:30:00 greater than the value measured at 2101-01-27 22:25:00?
SELECT (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 = 3369)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'he...
mimic_iii
CREATE TABLE table_name_99 ( group INTEGER, decay_constant__s_−1__ VARCHAR, fraction VARCHAR, half_life__s_ VARCHAR )
What is the lowest group number that has a Fraction less than 0.000748, a Half-Life of 55.72 and a Decay Constant larger than 0.012400000000000001?
SELECT MIN(group) FROM table_name_99 WHERE fraction < 0.000748 AND half_life__s_ = 55.72 AND decay_constant__s_−1__ > 0.012400000000000001
sql_create_context
CREATE TABLE table_45779 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
Which Tie number had Middlesbrough as the away team?
SELECT "Tie no" FROM table_45779 WHERE "Away team" = 'middlesbrough'
wikisql
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE intakeoutput ( intakeou...
what medication was first prescribed to patient 012-2739 via subcut since 147 months ago?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-2739')) AND medication.routeadmin = 'subcut' AND DATETIME(medic...
eicu
CREATE TABLE table_38779 ( "Team" text, "Stadium" text, "Capacity" real, "Highest" real, "Lowest" real, "Average" real )
Highest larger than 2,169, and a Average larger than 3,502 involves which team?
SELECT "Team" FROM table_38779 WHERE "Highest" > '2,169' AND "Average" > '3,502'
wikisql
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction varchar ) 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 i...
Will I be able to take SI 638 over the Winter ?
SELECT COUNT(*) > 0 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 COURSEalias0.course_id = COURSE_OFFERINGalias0.course_id AND NOT COURSEalias0.course_id IN...
advising
CREATE TABLE table_name_40 ( film VARCHAR, rank VARCHAR, director_s_ VARCHAR )
Which film, directed by Dana Dorian, was nominated?
SELECT film FROM table_name_40 WHERE rank = "nominated" AND director_s_ = "dana dorian"
sql_create_context
CREATE TABLE table_name_5 ( player VARCHAR, college VARCHAR )
What Player is from the College of memphis?
SELECT player FROM table_name_5 WHERE college = "memphis"
sql_create_context
CREATE TABLE table_3328 ( "Settlement" text, "Cyrillic Name Other Names" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
Name the population for (croatian: mono tor)
SELECT "Population (2011)" FROM table_3328 WHERE "Cyrillic Name Other Names" = 'Бачки Моноштор (Croatian: Monoštor)'
wikisql
CREATE TABLE table_name_22 ( fall_05 INTEGER, fall_09 VARCHAR, fall_08 VARCHAR )
What's the smallest fall 05 number when fall 09 is less than 14 and fall 08 is more than 5?
SELECT MIN(fall_05) FROM table_name_22 WHERE fall_09 < 14 AND fall_08 > 5
sql_create_context
CREATE TABLE table_name_18 ( second VARCHAR, sixth VARCHAR )
What is SECOND, when SIXTH is Victoria?
SELECT second FROM table_name_18 WHERE sixth = "victoria"
sql_create_context
CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE city ( city_code varchar, ...
RENTAL CAR in WASHINGTON
SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'WASHINGTON' AND ground_service.city_code = city.city_code AND ground_service.transport_type = 'RENTAL CAR'
atis
CREATE TABLE table_7976 ( "Game" real, "Date" text, "Team" text, "Score" text, "Record" text, "Streak" text )
What game number is the Kansas City Kings team?
SELECT "Game" FROM table_7976 WHERE "Team" = 'kansas city kings'
wikisql
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartr...
what were the top four common lab tests that patients had within the same month after having a insulin - subcutaneous dose of longer-acting insulin prepara procedure until 2 years ago?
SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'insulin - subcutaneous dose of longer-acting insulin...
eicu
CREATE TABLE table_36536 ( "Date" text, "Episode" real, "Performer 1" text, "Performer 2" text, "Performer 3" text, "Performer 4" text )
What is the average episode number on 19 March 1993 with Jim Sweeney as performer 1?
SELECT AVG("Episode") FROM table_36536 WHERE "Performer 1" = 'jim sweeney' AND "Date" = '19 march 1993'
wikisql
CREATE TABLE table_34440 ( "Date" text, "Label" text, "Region" text, "Format" text, "Catalog" text )
In what Region is Catalog number 885 380-1?
SELECT "Region" FROM table_34440 WHERE "Catalog" = '885 380-1'
wikisql
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
how many hours has elapsed since the last time that patient 033-22108 had an intake of enteral meds on the current intensive care unit visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', intakeoutput.intakeoutputtime)) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid ...
eicu
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 the sum of School_ID over the All_Home , and group by attribute All_Home, and display by the x-axis from low to high.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home ORDER BY All_Home
nvbench
CREATE TABLE table_71135 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What area did Julius Boros play at?
SELECT "Place" FROM table_71135 WHERE "Player" = 'julius boros'
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...
在病人27763330的医疗记录中,查一下医疗费总额高过2422.71元的入院诊断疾病名和编码
SELECT t_kc21.OUT_DIAG_DIS_CD, t_kc21.OUT_DIAG_DIS_NM FROM t_kc21 WHERE t_kc21.PERSON_ID = '27763330' AND t_kc21.MED_CLINIC_ID IN (SELECT t_kc21_t_kc24.MED_CLINIC_ID FROM t_kc24 WHERE t_kc24.MED_AMOUT > 2422.71)
css
CREATE TABLE table_1293 ( "Airline" text, "ICAO" text, "IATA" text, "Callsign" text, "Commenced operations" real, "Fleet size" real, "Headquarters" text )
When did the oldest airline start operations?
SELECT MIN("Commenced operations") FROM table_1293
wikisql
CREATE TABLE table_2719 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
Name the conference player of the year for east tennessee state
SELECT "Conference Player of the Year" FROM table_2719 WHERE "Regular Season Winner" = 'East Tennessee State'
wikisql
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 prescriptions...
what is days of hospital stay and discharge time of subject name kurt buczek?
SELECT demographic.days_stay, demographic.dischtime FROM demographic WHERE demographic.name = "Kurt Buczek"
mimicsql_data
CREATE TABLE table_74535 ( "Rider" text, "Bike" text, "Laps" real, "Time" text, "Grid" real )
Which bike did Jiri Drazdak ride when he had a grid number larger than 14 and less than 22 laps?
SELECT "Bike" FROM table_74535 WHERE "Grid" > '14' AND "Laps" < '22' AND "Rider" = 'jiri drazdak'
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 products with a price between 60 and 120, visualize a bar chart about the distribution of name and manufacturer , show Y in descending order.
SELECT Name, Manufacturer FROM Products WHERE Price BETWEEN 60 AND 120 ORDER BY Manufacturer DESC
nvbench
CREATE TABLE table_30279 ( "Position" text, "Number" real, "Player" text, "Super League" real, "Champions League" real, "Swiss Cup" real, "Total" real )
List the number of assists for the DF.
SELECT MAX("Total") FROM table_30279 WHERE "Position" = 'DF'
wikisql
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number...
Badge CreationDate is always NULL (IS THIS A BUG?).
SELECT Name, (SELECT COUNT(*) FROM Badges AS B WHERE B.Name = C.Name AND CreationDate IS NULL) AS "countnull", (SELECT COUNT(*) FROM Badges AS B WHERE B.Name = C.Name AND NOT CreationDate IS NULL) AS "countnotnull" FROM Badges AS C GROUP BY Name
sede
CREATE TABLE table_24565004_15 ( period VARCHAR, position VARCHAR )
List the number of active years for attaquant.
SELECT period FROM table_24565004_15 WHERE position = "Attaquant"
sql_create_context
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...
在医疗就诊49142439579中,科室名有美容的科室开了哪些检验报告单?需要这些报告单的编号
SELECT zyjybgb.BGDH FROM zyjybgb WHERE zyjybgb.JZLSH = '49142439579' AND zyjybgb.KSMC LIKE '%美容%' UNION SELECT mzjybgb.BGDH FROM mzjybgb WHERE mzjybgb.JZLSH = '49142439579' AND mzjybgb.KSMC LIKE '%美容%'
css
CREATE TABLE table_51766 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What was St Kilda's away team score?
SELECT "Away team score" FROM table_51766 WHERE "Home team" = 'st kilda'
wikisql
CREATE TABLE table_6398 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "Series" text )
Which game took place on April 22?
SELECT "Game" FROM table_6398 WHERE "Date" = 'april 22'
wikisql
CREATE TABLE table_71988 ( "Outcome" text, "Date" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What was Olga Govortsova's goal when she played on a clay surface on 26 May 2012?
SELECT "Score" FROM table_71988 WHERE "Surface" = 'clay' AND "Date" = '26 may 2012'
wikisql
CREATE TABLE table_66804 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Name the date when the attendance is more than 45,817
SELECT "Date" FROM table_66804 WHERE "Attendance" > '45,817'
wikisql