context
stringlengths
11
9.12k
question
stringlengths
0
1.06k
SQL
stringlengths
2
4.44k
source
stringclasses
28 values
CREATE TABLE table_20607 ( "Missouri vs." text, "Overall Record" text, "at Columbia" text, "at Opponents Venue" text, "at Neutral Site" text, "Last 5 Meetings" text, "Last 10 Meetings" text, "Current Streak" text )
What is the record at the neutral site for when the overall record is ui, 27-16?
SELECT "at Neutral Site" FROM table_20607 WHERE "Overall Record" = 'UI, 27-16'
wikisql
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...
are there any flights from BOSTON to SAN FRANCISCO which stop in WASHINGTON
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND CIT...
atis
CREATE TABLE Students ( first_name VARCHAR, last_name VARCHAR, address_id VARCHAR ) CREATE TABLE Addresses ( address_id VARCHAR, state_province_county VARCHAR )
What are the first names and last names of students with address in Wisconsin state?
SELECT T2.first_name, T2.last_name FROM Addresses AS T1 JOIN Students AS T2 ON T1.address_id = T2.address_id WHERE T1.state_province_county = "Wisconsin"
sql_create_context
CREATE TABLE table_name_32 ( livery VARCHAR, description VARCHAR, date VARCHAR )
Which Livery has a Description of 20t tanker, with a date later than 1941?
SELECT livery FROM table_name_32 WHERE description = "20t tanker" AND date > 1941
sql_create_context
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 a bar chart for team_id of each all neutral, and sort in descending by the Team_ID.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY Team_ID DESC
nvbench
CREATE TABLE gyb ( 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...
患者华俊誉之前得过什么病
SELECT qtb.IN_DIAG_DIS_CD, qtb.IN_DIAG_DIS_NM FROM qtb WHERE qtb.PERSON_NM = '华俊誉' UNION SELECT gyb.IN_DIAG_DIS_CD, gyb.IN_DIAG_DIS_NM FROM gyb WHERE gyb.PERSON_NM = '华俊誉' UNION SELECT zyb.IN_DIAG_DIS_CD, zyb.IN_DIAG_DIS_NM FROM zyb WHERE zyb.PERSON_NM = '华俊誉' UNION SELECT mzb.IN_DIAG_DIS_CD, mzb.IN_DIAG_DIS_NM FROM mz...
css
CREATE TABLE table_22909 ( "Carrier" text, "Standard" text, "Frequency" text, "Connection speed" text, "Launch date (dd.mm.yyyy)" text )
When the carrier is idc, what are the frequencies?
SELECT "Frequency" FROM table_22909 WHERE "Carrier" = 'IDC'
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
count the number of patients whose admission year is less than 2187 and procedure icd9 code is 3806?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2187" AND procedures.icd9_code = "3806"
mimicsql_data
CREATE TABLE table_69933 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" text )
Which week had an attendance of 51,265?
SELECT "Week" FROM table_69933 WHERE "Attendance" = '51,265'
wikisql
CREATE TABLE Addresses ( address_id INTEGER, address_details VARCHAR(255) ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VARCHAR(80), product_price DECIMAL(19,4) ) CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), su...
what are the names and ids of customers whose address contains TN?, I want to sort by the total number in desc.
SELECT customer_name, customer_id FROM Customers WHERE customer_address LIKE "%TN%" ORDER BY customer_id DESC
nvbench
CREATE TABLE table_58224 ( "Ship" text, "Pennant number" text, "Laid down" text, "Launched" text, "Completed" text )
What is the name of the ship that had a Pennant number of h55?
SELECT "Ship" FROM table_58224 WHERE "Pennant number" = 'h55'
wikisql
CREATE TABLE table_61403 ( "Shooter" text, "Event" text, "Rank points" text, "Score points" text, "Total" text )
Which Shooter has Score points of olympic silver medalist?
SELECT "Shooter" FROM table_61403 WHERE "Score points" = 'olympic silver medalist'
wikisql
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, ...
how many days have elapsed since patient 010-16572's first stay in the ward 498 in the current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', patient.unitadmittime)) FROM patient WHERE patient.uniquepid = '010-16572' AND patient.wardid = 498 AND patient.hospitaldischargetime IS NULL ORDER BY patient.unitadmittime LIMIT 1
eicu
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 vitalperiodic ( vitalpe...
calculate the number of times that morphine sulfate was prescribed to patient 007-849 during this hospital visit.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-849' AND patient.hospitaldischargetime IS NULL)) AND medication.drugname =...
eicu
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semester int, s...
For her classes , does Prof. Thomas Nalepa always set exams ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
advising
CREATE TABLE table_name_18 ( location VARCHAR, tournament VARCHAR )
What is the lowest first prize of the Mercedes Championships tournament in California?
SELECT MIN(1 AS st_prize___) AS $__ FROM table_name_18 WHERE location = "california" AND tournament = "mercedes championships"
sql_create_context
CREATE TABLE table_name_92 ( winning_team VARCHAR, losing_team VARCHAR )
Who won the series when the San Francisco Giants lost?
SELECT winning_team FROM table_name_92 WHERE losing_team = "san francisco giants"
sql_create_context
CREATE TABLE Catalogs ( catalog_id INTEGER, catalog_name VARCHAR(50), catalog_publisher VARCHAR(80), date_of_publication DATETIME, date_of_latest_revision DATETIME ) CREATE TABLE Catalog_Contents ( catalog_entry_id INTEGER, catalog_level_number INTEGER, parent_entry_id INTEGER, prev...
Compute how many attributes in each name of the attribute definitions with attribute value 0 Show the result with a bar chart, list from high to low by the x axis.
SELECT attribute_name, COUNT(attribute_name) FROM Attribute_Definitions AS t1 JOIN Catalog_Contents_Additional_Attributes AS t2 ON t1.attribute_id = t2.attribute_id WHERE t2.attribute_value = 0 GROUP BY attribute_name ORDER BY attribute_name DESC
nvbench
CREATE TABLE table_80344 ( "Year" text, "Start" text, "Qual" text, "Rank" text, "Finish" text, "Laps" real )
Name the rank for laps less than 130 and year of 1951
SELECT "Rank" FROM table_80344 WHERE "Laps" < '130' AND "Year" = '1951'
wikisql
CREATE TABLE table_58707 ( "Year" real, "Binibining Pilipinas-Universe" text, "Binibining Pilipinas-International" text, "Miss Maja Pilipinas" text, "Binibining Pilipinas-Tourism" text, "First runner-up" text, "Second runner-up" text )
What is the smallest Year with a Binibining Pilipinas-International of jessie alice salones dixson?
SELECT MIN("Year") FROM table_58707 WHERE "Binibining Pilipinas-International" = 'jessie alice salones dixson'
wikisql
CREATE TABLE customer_orders ( customer_id VARCHAR ) CREATE TABLE customers ( customer_name VARCHAR, customer_id VARCHAR )
Show the names of customers having an order with shipping method FedEx and order status Paid.
SELECT T1.customer_name FROM customers AS T1 JOIN customer_orders AS T2 ON T1.customer_id = T2.customer_id WHERE shipping_method_code = 'FedEx' AND order_status_code = 'Paid'
sql_create_context
CREATE TABLE table_name_26 ( week_4 VARCHAR, week_3 VARCHAR )
What is week 4 if week 3 is 35.40?
SELECT week_4 FROM table_name_26 WHERE week_3 = "35.40"
sql_create_context
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
what are the four commonly ordered drugs for patients diagnosed with acute respiratory failure previously within the same month, until 4 years ago?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'acute respiratory failure' AND DATETIME(diagnosis....
eicu
CREATE TABLE table_2508633_11 ( nfl_team VARCHAR, position VARCHAR, player VARCHAR )
What NFL Team has the player Danny Triplett with the position linebacker?
SELECT nfl_team FROM table_2508633_11 WHERE position = "Linebacker" AND player = "Danny Triplett"
sql_create_context
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) C...
which medication has drug code alte1/2l?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "ALTE1/2I"
mimicsql_data
CREATE TABLE table_16388506_1 ( away_team VARCHAR, ground VARCHAR )
Who are the away teams when subiaco oval was the grounds?
SELECT away_team FROM table_16388506_1 WHERE ground = "Subiaco Oval"
sql_create_context
CREATE TABLE table_11172 ( "Round" real, "Overall" real, "Player" text, "Nationality" text, "Club team" text )
What club was derrick byfuglien drafted by before 283?
SELECT "Club team" FROM table_11172 WHERE "Overall" < '283' AND "Player" = 'derrick byfuglien'
wikisql
CREATE TABLE table_10650 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What's the total grid of Bruce Mclaren?
SELECT COUNT("Grid") FROM table_10650 WHERE "Driver" = 'bruce mclaren'
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_CLINIC_ID text, MED_DIRE_CD tex...
在2005年3月22日到2009年1月7日内患者14111458被开出几次盐酸多奈哌齐胶囊?
SELECT COUNT(*) FROM gwyjzb JOIN t_kc22 ON gwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHERE gwyjzb.PERSON_ID = '14111458' AND t_kc22.STA_DATE BETWEEN '2005-03-22' AND '2009-01-07' AND t_kc22.SOC_SRT_DIRE_NM = '盐酸多奈哌齐胶囊' UNION SELECT COUNT(*) FROM fgwyjzb JOIN t_kc22 ON fgwyjzb.MED_CLINIC_ID = t_kc22.MED_CLINIC_ID WHER...
css
CREATE TABLE table_28342423_1 ( parent_unit VARCHAR, commanding_officer VARCHAR )
Name the parent unit for ludwig franzisket
SELECT parent_unit FROM table_28342423_1 WHERE commanding_officer = "Ludwig Franzisket"
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...
count the number of patients whose discharge location is rehab/distinct part hosp 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.discharge_location = "REHAB/DISTINCT PART HOSP" AND lab.label = "PTT"
mimicsql_data
CREATE TABLE MediaType ( MediaTypeId integer, Name varchar(120) ) CREATE TABLE Playlist ( PlaylistId integer, Name varchar(120) ) CREATE TABLE Album ( AlbumId integer, Title varchar(160), ArtistId integer ) CREATE TABLE Invoice ( InvoiceId integer, CustomerId integer, InvoiceD...
Plot the number of phone by grouped by phone as a bar graph, and I want to show in descending by the y axis.
SELECT Phone, COUNT(Phone) FROM Employee GROUP BY Phone ORDER BY COUNT(Phone) DESC
nvbench
CREATE TABLE table_12677 ( "Tries" real, "Player" text, "Opponent" text, "Score" text, "Venue" text, "Round" text )
What round is player phil graham in?
SELECT "Round" FROM table_12677 WHERE "Player" = 'phil graham'
wikisql
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost numb...
among patients who have been diagnosed with preterm nec 2500+g tell me the two year survival rate.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t2.charttime) > 2 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id...
mimic_iii
CREATE TABLE table_1341453_37 ( results VARCHAR, first_elected VARCHAR )
What was the result of the election in which the incumbent was first elected in 1984?
SELECT results FROM table_1341453_37 WHERE first_elected = 1984
sql_create_context
CREATE TABLE table_42607 ( "Condition" text, "Prothrombin time" text, "Partial thromboplastin time" text, "Bleeding time" text, "Platelet count" text )
Which Condition has a Bleeding time of prolonged, a Platelet count of decreased, and Prothrombin time of prolonged?
SELECT "Condition" FROM table_42607 WHERE "Bleeding time" = 'prolonged' AND "Platelet count" = 'decreased' AND "Prothrombin time" = 'prolonged'
wikisql
CREATE TABLE table_11869952_1 ( institutional_authority VARCHAR, rocket_launch VARCHAR )
Which authority has a rocket launch called rehbar-ii?
SELECT institutional_authority FROM table_11869952_1 WHERE rocket_launch = "Rehbar-II"
sql_create_context
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, ...
how many times does patient 27463 get a e 24 fs po intake since 08/2103?
SELECT COUNT(*) 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 = 27463)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'e 24 fs po' ...
mimic_iii
CREATE TABLE table_21222 ( "Province" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." real )
When the skip is Glenn Howard, what the minimum PF?
SELECT MIN("PF") FROM table_21222 WHERE "Skip" = 'Glenn Howard'
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, visualize a scatter chart about the correlation between manufacturer and revenue , and group by attribute name.
SELECT T1.Manufacturer, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
nvbench
CREATE TABLE table_11694832_1 ( no_in_series INTEGER, written_by VARCHAR )
What is the first series number that Adele Lim wrote?
SELECT MIN(no_in_series) FROM table_11694832_1 WHERE written_by = "Adele Lim"
sql_create_context
CREATE TABLE table_20823568_2 ( third_place_s_ VARCHAR, total_placing_s_ VARCHAR )
What is the total number of 3rd place entries that have exactly 8 total placings?
SELECT COUNT(third_place_s_) FROM table_20823568_2 WHERE total_placing_s_ = 8
sql_create_context
CREATE TABLE table_name_98 ( tournament VARCHAR, opponent VARCHAR )
What tournament did the Crusaders play in?
SELECT tournament FROM table_name_98 WHERE opponent = "crusaders"
sql_create_context
CREATE TABLE table_14321 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Name the most attendance whent he record is 45-57
SELECT MAX("Attendance") FROM table_14321 WHERE "Record" = '45-57'
wikisql
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...
For all artist names who are not from the United States, show the total number of each year with a bar chart.
SELECT Year_Join, COUNT(Year_Join) FROM artist WHERE Country <> 'United States' GROUP BY Year_Join
nvbench
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...
To how many patients with st elevated myocardial infarction or cardiac cath as their primary disease was iv drip administered/presribed?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND prescriptions.route = "IV DRIP"
mimicsql_data
CREATE TABLE table_9340 ( "Episode" text, "7 Deadly Sin" text, "Challenge Winner" text, "Challenge Loser" text, "Voted In To 'El Duelo'" text, "Eliminated" text )
Which challenge loser has a Challenge Winner of roseny?
SELECT "Challenge Loser" FROM table_9340 WHERE "Challenge Winner" = 'roseny'
wikisql
CREATE TABLE table_name_70 ( date VARCHAR, decision VARCHAR, attendance VARCHAR )
What was the date of the game with a decision of Lehtonen and attended by more than 17,731 people?
SELECT date FROM table_name_70 WHERE decision = "lehtonen" AND attendance > 17 OFFSET 731
sql_create_context
CREATE TABLE table_22375 ( "Mexico" text, "Ma\u00f1ana es para siempre" text, "El Canal de las Estrellas" text, "October 20, 2008" text, "June 14, 2009" text, "Monday to Friday" text )
state el canal de las estrellas where ma ana es para siempre is impreuna pentru totdeauna
SELECT "El Canal de las Estrellas" FROM table_22375 WHERE "Ma\u00f1ana es para siempre" = 'Impreuna pentru totdeauna'
wikisql
CREATE TABLE table_45795 ( "Year" text, "Result" text, "Matches" text, "Wins" text, "Draws" text, "Losses" text )
What is Year, when Wins is '0'?
SELECT "Year" FROM table_45795 WHERE "Wins" = '0'
wikisql
CREATE TABLE table_name_33 ( wheels VARCHAR, built VARCHAR )
Which wheels were built 1920?
SELECT wheels FROM table_name_33 WHERE built = 1920
sql_create_context
CREATE TABLE hz_info ( KH text, KLX number, RYBH text, YLJGDM text ) 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, ...
叫做水锐逸的患者在01年9月3日到2020年9月18日这段时间在编号为2777621的医疗机构的门诊就诊过几次?
SELECT COUNT(*) FROM person_info JOIN hz_info JOIN mzjzjlb JOIN hz_info_mzjzjlb ON person_info.RYBH = hz_info.RYBH AND hz_info.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_info.KH = mzjzjlb.KH AND hz_info.KLX = mzjzjlb.KLX AND hz_info_mzjzjlb.JZLSH = mzjzjlb.JZLSH AND hz_info_mzjzjlb.YLJGDM = hz_info_mzjzjlb.YLJGDM AND hz_in...
css
CREATE TABLE table_19905183_1 ( team VARCHAR, province VARCHAR )
What team is from the Eastern province?
SELECT team FROM table_19905183_1 WHERE province = "Eastern"
sql_create_context
CREATE TABLE table_3097 ( "Theatre name" text, "Digital Screens" real, "IMAX Screens" real, "Location" text, "Language of films" text )
Name the theatre name for french
SELECT "Theatre name" FROM table_3097 WHERE "Language of films" = 'French'
wikisql
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 intakeoutput ( in...
when was the first time patient 013-20464 has been diagnosed with suicidal ideation since 3 years ago?
SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-20464')) AND diagnosis.diagnosisname = 'suicidal ideation' AN...
eicu
CREATE TABLE table_204_897 ( id number, "date" text, "opponent#" text, "rank#" text, "site" text, "tv" text, "result" text, "attendance" number )
what was the difference between the two scores of the last game ?
SELECT ABS("result" - "result") FROM table_204_897 ORDER BY "date" DESC LIMIT 1
squall
CREATE TABLE table_17004 ( "Disaster" text, "Year" text, "Countries Affected" text, "Scale of Disaster" text, "People Assisted" text, "Nature of Help" text )
What was the scale of disaster in Peru?
SELECT "Scale of Disaster" FROM table_17004 WHERE "Countries Affected" = 'Peru'
wikisql
CREATE TABLE table_name_92 ( stopping_pattern VARCHAR, platform VARCHAR )
What is Stopping Pattern, when Platform is 4?
SELECT stopping_pattern FROM table_name_92 WHERE platform = "4"
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 demographic ( subject_id text, hadm_id text, name text, marital_status text, age text, dob text, gender text, ...
How many patients taking drug via dwell route are diagnosed with unspecified hereditary and idiopathic peripheral neuropathy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Idio periph neurpthy NOS" AND prescriptions.route = "DWELL"
mimicsql_data
CREATE TABLE aircraft ( aid number(9,0), name varchar2(30), distance number(6,0) ) CREATE TABLE certificate ( eid number(9,0), aid number(9,0) ) CREATE TABLE employee ( eid number(9,0), name varchar2(30), salary number(10,2) ) CREATE TABLE flight ( flno number(4,0), origin var...
Show name and distance for all aircrafts. Visualize by bar chart.
SELECT name, distance FROM aircraft
nvbench
CREATE TABLE table_18909 ( "Tournament" text, "Matches" real, "Wins Olimpia" real, "Empates" real, "Wins Cerro" real, "Goals Olimpia" real, "Goals Cerro" real )
What was the number of matches when the Goals Olimpia was 149?
SELECT "Matches" FROM table_18909 WHERE "Goals Olimpia" = '149'
wikisql
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREA...
calculate patient 027-107035's length of stay of the first hospital stay.
SELECT STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', patient.hospitaladmittime) FROM patient WHERE patient.uniquepid = '027-107035' AND NOT patient.hospitaladmittime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
eicu
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program ( program_id int, name varchar, college varc...
Are there any professors that do not teach classes with labs ?
SELECT DISTINCT instructor.name FROM instructor, course, course_offering, offering_instructor WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course_offering.offering_id = offering_instructor.offering_id AND instructor.instructor_id = offering_instructor.instructor_id AND NOT instr...
advising
CREATE TABLE zyjzjlb ( YLJGDM text, JZLSH text, MZJZLSH text, KH text, KLX number, HZXM text, WDBZ number, RYDJSJ time, RYTJDM number, RYTJMC text, JZKSDM text, JZKSMC text, RZBQDM text, RZBQMC text, RYCWH text, CYKSDM text, CYKSMC text, CYBQDM tex...
报一下身高和体重,患者褚永福的
SELECT mzjzjlb.SG, mzjzjlb.TZ FROM person_info JOIN hz_info JOIN mzjzjlb 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 WHERE person_info.XM = '褚永福'
css
CREATE TABLE table_65160 ( "HR no." text, "HR name" text, "CR no." real, "LMS no." real, "Built" text, "Works" text, "Withdrawn" text )
What's the CR number that has an LMS number less than 14761 and works of Hawthorn Leslie 3100?
SELECT AVG("CR no.") FROM table_65160 WHERE "Works" = 'hawthorn leslie 3100' AND "LMS no." < '14761'
wikisql
CREATE TABLE table_65104 ( "Nat." text, "Name" text, "Moving from" text, "Type" text, "Transfer window" text, "Ends" real, "Transfer fee" text )
What is the transfer fee for Helguera?
SELECT "Transfer fee" FROM table_65104 WHERE "Name" = 'helguera'
wikisql
CREATE TABLE table_2562572_44 ( settlement VARCHAR, cyrillic_name_other_names VARCHAR )
Which settlement has the cyrillic and other name of (romanian: locve)?
SELECT settlement FROM table_2562572_44 WHERE cyrillic_name_other_names = "Локве (Romanian: Locve)"
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 code_description ( code varchar, description text ) CREATE TABLE airline ( airline_co...
on UA give me the flight times from BOSTON to DALLAS
SELECT DISTINCT flight.departure_time 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 = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'D...
atis
CREATE TABLE table_26910 ( "Codename (main article)" text, "Brand name (list)" text, "Cores" real, "L3 Cache" text, "Socket" text, "TDP" text, "I/O Bus" text )
What i/o buses are associated with the LGA 1155 socket, a code name of Sandy Bridge (desktop) and a brand name of Core i3-21xx?
SELECT "I/O Bus" FROM table_26910 WHERE "Socket" = 'LGA 1155' AND "Codename (main article)" = 'Sandy Bridge (Desktop)' AND "Brand name (list)" = 'Core i3-21xx'
wikisql
CREATE TABLE table_name_89 ( term_end VARCHAR, term_start VARCHAR )
When did the term end for the person who started their term on 28 November 1912?
SELECT term_end FROM table_name_89 WHERE term_start = "28 november 1912"
sql_create_context
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE lab ( labid number, pat...
what is the name of the medication that patient 006-81423 was prescribed in the same hospital visit after being diagnosed with intracranial injury - with intracerebral hemorrhage until 35 months ago?
SELECT t2.drugname FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
eicu
CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE restriction ( restriction_c...
find a flight from TORONTO to SAN DIEGO with a layover in WASHINGTON on DL
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2...
atis
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text )...
what was the minimum monthly number of patients who had late eff accidental fall since 6 years ago?
SELECT MIN(t1.c1) FROM (SELECT COUNT(DISTINCT diagnoses_icd.hadm_id) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'late eff accidental fall') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year'...
mimic_iii
CREATE TABLE table_name_8 ( type VARCHAR, location VARCHAR )
What type of bridge is in Cooperstown?
SELECT type FROM table_name_8 WHERE location = "cooperstown"
sql_create_context
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, give me the comparison about the sum of price over the name , and group by attribute name by a bar chart, and rank by the y axis from low to high.
SELECT T2.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T1.Price
nvbench
CREATE TABLE table_9203 ( "Born as" text, "Consort as" text, "Born" text, "Marriage" text, "Consort from" text, "Consort to" text, "Died" text, "Spouse to" text )
When did the consort who had talal i as a spouse die?
SELECT "Died" FROM table_9203 WHERE "Spouse to" = 'talal i'
wikisql
CREATE TABLE table_72442 ( "Name" text, "Pennant number" text, "Builder" text, "Laid Down" text, "Launched" text, "Commissioned" text, "Current status" text )
Which launch date involved the Driade?
SELECT "Launched" FROM table_72442 WHERE "Name" = 'Driade'
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...
编号为5026399医疗机构目前在院多少人?
SELECT COUNT(*) FROM t_kc21 WHERE t_kc21.MED_SER_ORG_NO = '5026399' AND t_kc21.HOSP_STS > 0
css
CREATE TABLE table_12019 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team at corio oval?
SELECT "Away team" FROM table_12019 WHERE "Venue" = 'corio oval'
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...
list the top three most frequent prescriptions that a patient has been prescribed with during the same hospital visit after being diagnosed with av block - second degree until 2101.
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'av block - seco...
eicu
CREATE TABLE table_39372 ( "Round" real, "Pick #" real, "Overall" real, "Name" text, "Position" text, "College" text )
Which College has a Round smaller than 7, and a Pick # smaller than 27, and a Name of anthony maddox?
SELECT "College" FROM table_39372 WHERE "Round" < '7' AND "Pick #" < '27' AND "Name" = 'anthony maddox'
wikisql
CREATE TABLE Badges ( Id number, UserId number, Name text, Date time, Class number, TagBased boolean ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABL...
Find questions with one specific tag.
SELECT Id AS "post_link", CreationDate FROM Posts WHERE PostTypeId = 1 AND Tags LIKE LOWER('%hard-science%') ORDER BY CreationDate DESC LIMIT 5000
sede
CREATE TABLE table_45649 ( "Game" real, "Date" text, "Opponent" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location/Attendance" text, "Record" text )
What is Score, when High Rebounds is 'Nolan (10)'?
SELECT "Score" FROM table_45649 WHERE "High rebounds" = 'nolan (10)'
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients aged below 41 years had the lab test pleural?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.age < "41" AND lab.fluid = "Pleural"
mimicsql_data
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...
查一查医院7449354全部诊疗记录中,有不一样的出院诊断疾病编码的患者和在不同科室的患者平均有多大
SELECT gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD, AVG(gwyjzb.PERSON_AGE) FROM gwyjzb WHERE gwyjzb.MED_SER_ORG_NO = '7449354' GROUP BY gwyjzb.MED_ORG_DEPT_NM, gwyjzb.OUT_DIAG_DIS_CD UNION SELECT fgwyjzb.MED_ORG_DEPT_NM, fgwyjzb.OUT_DIAG_DIS_CD, AVG(fgwyjzb.PERSON_AGE) FROM fgwyjzb WHERE fgwyjzb.MED_SER_ORG_NO = '74...
css
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id numb...
count the number of people who were prescribed methadone hcl in the same hospital visit after having received a cont inv mec ven 96+ hrs procedure until 2102.
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, procedures_icd.charttime, admissions.hadm_id FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_...
mimic_iii
CREATE TABLE lessons ( lesson_id number, customer_id number, lesson_status_code text, staff_id number, vehicle_id number, lesson_date time, lesson_time text, price number ) CREATE TABLE addresses ( address_id number, line_1_number_building text, city text, zip_postcode t...
How many employees are there?
SELECT COUNT(*) FROM staff
spider
CREATE TABLE table_4369 ( "Year" real, "Association" text, "Category" text, "Nominated work" text, "Result" text )
Tell me the category for result of won and year more than 2009
SELECT "Category" FROM table_4369 WHERE "Result" = 'won' AND "Year" > '2009'
wikisql
CREATE TABLE table_name_78 ( format VARCHAR, catalogue VARCHAR )
What format is catalogue 148615 in?
SELECT format FROM table_name_78 WHERE catalogue = "148615"
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...
从00年二月二十一日到0八年八月二十九日,患者91428199在哪几个医院看过病
SELECT COUNT(qtb.MED_SER_ORG_NO) FROM qtb WHERE qtb.PERSON_ID = '91428199' AND qtb.IN_HOSP_DATE BETWEEN '2000-02-21' AND '2008-08-29' UNION SELECT COUNT(gyb.MED_SER_ORG_NO) FROM gyb WHERE gyb.PERSON_ID = '91428199' AND gyb.IN_HOSP_DATE BETWEEN '2000-02-21' AND '2008-08-29' UNION SELECT COUNT(zyb.MED_SER_ORG_NO) FROM zy...
css
CREATE TABLE table_name_76 ( year INTEGER, athlete VARCHAR, time VARCHAR )
Which Year is the lowest one that has an Athlete of markus thalmann, and a Time of 23:28:24?
SELECT MIN(year) FROM table_name_76 WHERE athlete = "markus thalmann" AND time = "23:28:24"
sql_create_context
CREATE TABLE table_22839669_12 ( total_wins INTEGER )
What is the maximum total wins he had for any year?
SELECT MAX(total_wins) FROM table_22839669_12
sql_create_context
CREATE TABLE table_18904831_6 ( high_points VARCHAR, high_rebounds VARCHAR )
When dydek (8) has the highest rebounds who has the highest amount of points?
SELECT high_points FROM table_18904831_6 WHERE high_rebounds = "Dydek (8)"
sql_create_context
CREATE TABLE student ( stuid number, lname text, fname text, age number, sex text, major number, advisor number, city_code text ) CREATE TABLE participates_in ( stuid number, actid number ) CREATE TABLE faculty_participates_in ( facid number, actid number ) CREATE TABL...
How many female Professors do we have?
SELECT COUNT(*) FROM faculty WHERE sex = 'F' AND rank = "Professor"
spider
CREATE TABLE Movie ( mID int, title text, year int, director text ) CREATE TABLE Rating ( rID int, mID int, stars int, ratingDate date ) CREATE TABLE Reviewer ( rID int, name text )
Visualize the title and and the total star rating of the movie using a bar chart, could you display bars in descending order?
SELECT title, SUM(stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY title ORDER BY title DESC
nvbench
CREATE TABLE table_79645 ( "Year" real, "Player" text, "Country" text, "Score" text, "To Par" text, "Margin" real, "Earnings ($)" real )
What is russ cochran's average margin?
SELECT AVG("Margin") FROM table_79645 WHERE "Player" = 'russ cochran'
wikisql
CREATE TABLE staff ( staff_name VARCHAR, staff_gender VARCHAR, staff_id VARCHAR ) CREATE TABLE staff_department_assignments ( staff_id VARCHAR, date_assigned_from VARCHAR )
Return the name and gender of the staff who was assigned in 2016.
SELECT T1.staff_name, T1.staff_gender FROM staff AS T1 JOIN staff_department_assignments AS T2 ON T1.staff_id = T2.staff_id WHERE T2.date_assigned_from LIKE "2016%"
sql_create_context
CREATE TABLE Ref_Calendar ( Calendar_Date DATETIME, Day_Number INTEGER ) CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Documents_to_be_Destroyed ( Document_ID INTEGER, Destruction_Authorised_by_Employee_ID INTEGER, Destroy...
Show the number of documents for each location code in a bar chart, and could you rank from low to high by the X?
SELECT Location_Code, COUNT(Location_Code) FROM Document_Locations GROUP BY Location_Code ORDER BY Location_Code
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 ) ...
report the number of patients with other convulsions diagnoses who had csf lab test done.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Convulsions NEC" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
mimicsql_data
CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25), COUNTRY_ID varchar(2) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), ...
For those employees who was hired before 2002-06-21, find job_id and the sum of department_id , and group by attribute job_id, and visualize them by a bar chart, display JOB_ID in ascending order.
SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID
nvbench