table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid number, wa...
tell me the name of the drug which patient 004-79017 was prescribed within 2 days after receiving a vasopressors - norepinephrine <= 0.1 micrograms/kg/min procedure since 05/2101?
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-79017') AND treatment.treatme...
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDat...
Number of questions per month for a tag.
SELECT STR_TO_TIME(caffe.month + '-01 13:37:00', '%Y-%m-%d %H:%M:%S') AS "month", caffe.count AS "caffe", tf.count AS "tensorflow" FROM (SELECT CAST(TIME_TO_STR(CreationDate, '%Y-%m-%d %H:%M:%S') AS TEXT(7)) AS "month", COUNT(*) AS "count" FROM "stackoverflow".dbo.Posts AS p WHERE p.PostTypeId = 1 AND p.Tags LIKE '%<ca...
CREATE TABLE table_56275 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Record" text )
What was the loss when the record was 34-56?
SELECT "Loss" FROM table_56275 WHERE "Record" = '34-56'
CREATE TABLE table_9377 ( "Place" text, "Player" text, "Country" text, "Score" real, "To par" text )
Which To par has a Score larger than 68?
SELECT "To par" FROM table_9377 WHERE "Score" > '68'
CREATE TABLE aircraft ( aircraft_code varchar, aircraft_description varchar, manufacturer varchar, basic_type varchar, engines int, propulsion varchar, wide_body varchar, wing_span int, length int, weight int, capacity int, pay_load int, cruising_speed int, range_...
explain the restriction AP/80
SELECT DISTINCT advance_purchase, application, maximum_stay, minimum_stay, no_discounts, restriction_code, saturday_stay_required, stopovers FROM restriction WHERE restriction_code = 'AP/80'
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
had patient 11826 received a glucose tests in the current hospital visit?
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 11826 AND admissions.dischtime IS NULL)
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodi...
what's the name of the drug patient 009-5801 is allergic to in 03/2100.
SELECT allergy.drugname FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-5801')) AND STRFTIME('%y-%m', allergy.allergytime) = '2100-03'
CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEG...
How many dorms are there for each gender? Plot apie chart.
SELECT gender, COUNT(*) FROM Dorm GROUP BY gender
CREATE TABLE table_1969577_1 ( joined INTEGER, institution VARCHAR )
Name the most joined for molloy college
SELECT MAX(joined) FROM table_1969577_1 WHERE institution = "Molloy College"
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...
mention the diagnosis long title and procedure icd9 code of subject id 7578.
SELECT diagnoses.long_title, procedures.icd9_code FROM diagnoses INNER JOIN procedures ON diagnoses.hadm_id = procedures.hadm_id WHERE diagnoses.subject_id = "7578"
CREATE TABLE table_67114 ( "Rank" real, "Airport" text, "City" text, "Code (IATA/ICAO)" text, "2008" real, "2009" real, "2010" real )
What is the rank of airport with a (IATA/ICAO) of bcm/lrbc code and an amount of 240,735 in 2010?
SELECT MIN("Rank") FROM table_67114 WHERE "Code (IATA/ICAO)" = 'bcm/lrbc' AND "2010" > '240,735'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE m...
when is the first time patient 016-29746 received a alpha/beta blocker treatment in 2104?
SELECT treatment.treatmenttime FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND treatment.treatmentname = 'alpha/beta blocker' A...
CREATE TABLE table_name_14 ( opponent VARCHAR, date VARCHAR )
What opponent has april 10 as the date?
SELECT opponent FROM table_name_14 WHERE date = "april 10"
CREATE TABLE table_45395 ( "Rank" text, "Name" text, "Height (m)" real, "Height (ft)" real, "Floors" text )
What is the Height (m) of the 32= Rank Building with 18 Floors and Height (ft) greater than 171?
SELECT AVG("Height (m)") FROM table_45395 WHERE "Floors" = '18' AND "Height (ft)" > '171' AND "Rank" = '32='
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, visualize a scatter chart about the correlation between price and manufacturer , and group by attribute name.
SELECT T1.Price, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Name
CREATE TABLE table_32011 ( "Name" text, "Circuit" text, "Date" text, "Winning drivers" text, "Winning constructor" text, "Report" text )
What brand of vehicle won a race driven by Tazio Nuvolari?
SELECT "Winning constructor" FROM table_32011 WHERE "Winning drivers" = 'tazio nuvolari'
CREATE TABLE drivers ( forename VARCHAR, surname VARCHAR, nationality VARCHAR )
Find the forename and surname of drivers whose nationality is German?
SELECT forename, surname FROM drivers WHERE nationality = "German"
CREATE TABLE table_27895 ( "Settlement" text, "Cyrillic Name" text, "Type" text, "Population (2011)" real, "Largest ethnic group (2002)" text, "Dominant religion (2002)" text )
How many different types of settlements does Nova Pazova fall into?
SELECT COUNT("Type") FROM table_27895 WHERE "Settlement" = 'Nova Pazova'
CREATE TABLE table_name_93 ( silver VARCHAR, nation VARCHAR )
How many silver medals does China have?
SELECT COUNT(silver) FROM table_name_93 WHERE nation = "china"
CREATE TABLE table_47042 ( "Tournament" text, "1990" text, "1991" text, "1992" text, "1993" text, "1994" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "Career SR" text, "Career Win-Loss" text )
What is the 1999 finish for the tournament in Rome?
SELECT "1999" FROM table_47042 WHERE "Tournament" = 'rome'
CREATE TABLE icustays ( row_id number, subject_id number, hadm_id number, icustay_id number, first_careunit text, last_careunit text, first_wardid number, last_wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, ...
what was the first value of rdw of patient 15905 since 110 months ago?
SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 15905) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'rdw') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '-110 month'...
CREATE TABLE table_30891 ( "Number" text, "Serial Number" real, "Into Service" text, "Withdrawn" text, "Scrapped" text )
Name the into service for dh2
SELECT "Into Service" FROM table_30891 WHERE "Number" = 'DH2'
CREATE TABLE table_name_93 ( enrollment_08_09 VARCHAR, school VARCHAR )
What was the total enrollment 08-09 of Franklin County?
SELECT COUNT(enrollment_08_09) FROM table_name_93 WHERE school = "franklin county"
CREATE TABLE table_202_76 ( id number, "member" text, "party" text, "term" text )
which member of the second incarnation of the lachlan was also a nationalist ?
SELECT "member" FROM table_202_76 WHERE "party" = 'nationalist'
CREATE TABLE table_dev_59 ( "id" int, "gender" string, "st_elevation" int, "tow_contiguous_limb" bool, "body_weight" float, "renal_disease" bool, "estimated_glomerular_filtration_rate_egfr" int, "two_contiguous_precordial_leads" bool, "unprotected_left_main_stenosis" int, "body_m...
estimated body weight < 120 kg and bmi < 40
SELECT * FROM table_dev_59 WHERE body_weight < 120 AND body_mass_index_bmi < 40
CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(50), product_price DECIMAL(19,4), derived_product_cost DECIMAL(19,4), derived_vat_payable DECIMAL(19,4), derived_total_cost DECIMAL...
Show the transaction types and the total amount of transactions with a pie chart.
SELECT transaction_type, SUM(transaction_amount) FROM Financial_Transactions GROUP BY transaction_type
CREATE TABLE table_55801 ( "Name" text, "Date of birth" text, "Date of death" text, "Reign" text, "Relationship with predecessor" text )
What was the Reign of the person whose Date of Birth was 22 March 1459?
SELECT "Reign" FROM table_55801 WHERE "Date of birth" = '22 march 1459'
CREATE TABLE table_39157 ( "Game" real, "November" real, "Opponent" text, "Score" text, "Record" text, "Points" real )
How many games have November 7 as the date, and points greater than 17?
SELECT COUNT("Game") FROM table_39157 WHERE "November" = '7' AND "Points" > '17'
CREATE TABLE table_52499 ( "Race" text, "Circuit" text, "Date" text, "Pole position" text, "Fastest lap" text, "Winning driver" text, "Constructor" text, "Tyre" text, "Report" text )
Who was the winning driver for the Dutch Grand Prix?
SELECT "Winning driver" FROM table_52499 WHERE "Race" = 'dutch grand prix'
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 text, icustay_id text, drug_type text, drug text, formulary_drug_cd text, route text, drug_dose text ) ...
what is the number of patients whose days of hospital stay is greater than 0 and drug name is citalopram?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "0" AND prescriptions.drug = "Citalopram"
CREATE TABLE table_name_84 ( senior_list VARCHAR, date_of_birth__age_when_delisted_ VARCHAR )
What is listed under Senior List for Date of Birth (Age When Delisted) of 5 June 1984 (aged 23)?
SELECT senior_list FROM table_name_84 WHERE date_of_birth__age_when_delisted_ = "5 june 1984 (aged 23)"
CREATE TABLE table_45771 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the record on October 13, when philadelphia was the home team?
SELECT "Record" FROM table_45771 WHERE "Home" = 'philadelphia' AND "Date" = 'october 13'
CREATE TABLE table_29853 ( "English" text, "Predecessor" text, "Ekavian" text, "Ikavian" text, "Ijekavian" text, "Ijekavian development" text )
What's the Ikavian translation of the Ijekavian word lijep?
SELECT "Ikavian" FROM table_29853 WHERE "Ijekavian" = 'lijep'
CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number ) CREATE TABLE college ( cname text, state text, enr number )
What is the number of states that has some colleges whose enrollment is smaller than the average enrollment?
SELECT COUNT(DISTINCT state) FROM college WHERE enr < (SELECT AVG(enr) FROM college)
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE time_zone ( time_zone_code text, time_zone_name text, hours_from_gmt int ) CREATE TABLE food_service ( meal_code text, meal_number int, compa...
list flights from PITTSBURGH to NEWARK on monday morning
SELECT DISTINCT flight_id FROM flight WHERE (((flight_days IN (SELECT DAYSalias0.days_code FROM days AS DAYSalias0 WHERE DAYSalias0.day_name IN (SELECT DATE_DAYalias0.day_name FROM date_day AS DATE_DAYalias0 WHERE DATE_DAYalias0.day_number = 21 AND DATE_DAYalias0.month_number = 2 AND DATE_DAYalias0.year = 1991)) AND to...
CREATE TABLE table_name_34 ( grid VARCHAR, time_retired VARCHAR )
What grid has a Time/Retired of +5 laps?
SELECT grid FROM table_name_34 WHERE time_retired = "+5 laps"
CREATE TABLE document_structures ( document_structure_code text, parent_document_structure_code text, document_structure_description text ) CREATE TABLE document_sections_images ( section_id number, image_id number ) CREATE TABLE document_sections ( section_id number, document_code text, ...
Count the number of users that are logged in.
SELECT COUNT(*) FROM users WHERE user_login = 1
CREATE TABLE table_225099_3 ( successor VARCHAR, state__class_ VARCHAR )
Who was the successor for the state of Maine (2) ?
SELECT successor FROM table_225099_3 WHERE state__class_ = "Maine (2)"
CREATE TABLE table_5714 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Points" real )
How many points have pittsburgh as the visitor, and philadelphia as the home?
SELECT COUNT("Points") FROM table_5714 WHERE "Visitor" = 'pittsburgh' AND "Home" = 'philadelphia'
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Bar chart, X is bed type and the Y-axis is their appearance frequency, show by the names in ascending.
SELECT bedType, COUNT(bedType) FROM Rooms WHERE decor = "traditional" GROUP BY bedType ORDER BY bedType
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 School_ID over the Team_Name , order by the total number in descending.
SELECT Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Ref_Document_Types ( Document_Type_Code CHAR(15), Document_Type_Name VARCHAR(255), Document_Type_Descrip...
Return a bar chart showing the number of documents for each document type name.
SELECT Document_Type_Name, COUNT(Document_Type_Name) FROM Ref_Document_Types AS T1 JOIN Documents AS T2 ON T1.Document_Type_Code = T2.Document_Type_Code GROUP BY Document_Type_Name
CREATE TABLE table_77855 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Which Venue has a Home team score of 9.16 (70)?
SELECT "Venue" FROM table_77855 WHERE "Home team score" = '9.16 (70)'
CREATE TABLE table_name_20 ( venue VARCHAR, event VARCHAR, year VARCHAR, competition VARCHAR )
what is the venue when the year is 2006, the competition is asian games and the event is 400 m?
SELECT venue FROM table_name_20 WHERE year = 2006 AND competition = "asian games" AND event = "400 m"
CREATE TABLE table_name_99 ( sub_parish__sogn_ VARCHAR, church_name VARCHAR )
Which Sub-Parish (Sogn) has a church named Jostedal Kyrkje?
SELECT sub_parish__sogn_ FROM table_name_99 WHERE church_name = "jostedal kyrkje"
CREATE TABLE table_73746 ( "Position" real, "Driver" text, "Points" real, "Winnings" text, "Series" text )
How much did Jeff Burton win?
SELECT "Winnings" FROM table_73746 WHERE "Driver" = 'Jeff Burton'
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 cost ( costid num...
has patient 032-4849 been admitted into an emergency room on the first hospital encounter?
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '032-4849' AND patient.hospitaladmitsource = 'emergency department' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmittime LIMIT 1
CREATE TABLE table_43971 ( "Pilot" text, "Date" text, "Place" text, "Weapon" text, "Effect" text )
What is Pilot, when Weapon is '35mm fire', and when Date is '4 May 1982'?
SELECT "Pilot" FROM table_43971 WHERE "Weapon" = '35mm fire' AND "Date" = '4 may 1982'
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 lab ( subject_id text, hadm_id text, ...
provide the number of patients whose insurance is private and procedure long title is endoscopic removal of stone(s) from biliary tract?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.long_title = "Endoscopic removal of stone(s) from biliary tract"
CREATE TABLE table_255829_1 ( municipality VARCHAR, pop_density__per_km_2__ VARCHAR )
What municipality has a 130.6 pupulation density?
SELECT municipality FROM table_255829_1 WHERE pop_density__per_km_2__ = "130.6"
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 labevents ( row_id number, subject_id number, ...
what is the yearly maximum amount of myelocytes patient 19412 has?
SELECT MAX(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19412) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'myelocytes') GROUP BY STRFTIME('%y', labevents.charttime)
CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE branch ( branch_id number, name text, open_year text, address_road text, city text, membership_amount text ) CREATE TABLE membership_register_branch ( member_...
Find the name of branches where have some members whose hometown is in Louisville, Kentucky and some in Hiram, Georgia.
SELECT 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 WHERE T3.hometown = 'Louisville , Kentucky' INTERSECT SELECT T2.name FROM membership_register_branch AS T1 JOIN branch AS T2 ON T1.branch_id = T2.branch_id JOIN member ...
CREATE TABLE table_name_1 ( leading_man VARCHAR, year VARCHAR, director VARCHAR )
What leading man earlier than 1932 was directed by archie mayo?
SELECT leading_man FROM table_name_1 WHERE year < 1932 AND director = "archie mayo"
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 primarily suffering from sdh had their lab test fluid as urine?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "SDH" AND lab.fluid = "Urine"
CREATE TABLE table_25807 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
How many people led in assists on game 71?
SELECT COUNT("High assists") FROM table_25807 WHERE "Game" = '71'
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
All your accepted answers by others.
SELECT q.Id AS "post_link", a.Score AS Score FROM Posts AS q INNER JOIN Posts AS a ON q.AcceptedAnswerId = a.Id WHERE a.OwnerUserId = @UserId AND a.PostTypeId = 2 AND q.OwnerUserId != @UserId ORDER BY a.Score DESC
CREATE TABLE table_23285761_7 ( high_assists VARCHAR, high_rebounds VARCHAR )
Who did the high assists in the game where Amar'e Stoudemire (10) did the high rebounds?
SELECT high_assists FROM table_23285761_7 WHERE high_rebounds = "Amar'e Stoudemire (10)"
CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student_record ( student_id int, course_id int, ...
For AAS 211 , who were the GSIs last semester ?
SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course...
CREATE TABLE table_name_91 ( week VARCHAR, opponent VARCHAR )
Which week was the game against the San Diego Chargers?
SELECT week FROM table_name_91 WHERE opponent = "san diego chargers"
CREATE TABLE table_2618142_1 ( title VARCHAR, directed_by VARCHAR )
name the title of the episode that ed sherin directed.
SELECT title FROM table_2618142_1 WHERE directed_by = "Ed Sherin"
CREATE TABLE table_37940 ( "School" text, "City" text, "Team Name" text, "Enrollment" real, "IHSAA Class" text, "IHSAA Football Class" text, "County" text )
What is the IHSAA class in Batesville?
SELECT "IHSAA Class" FROM table_37940 WHERE "City" = 'batesville'
CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE program_requirement ( program_id int...
Who were the GSIs for STATS 520 last semester ?
SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course...
CREATE TABLE table_26998 ( "Name of Village" text, "Name in Syriac" text, "Number of Believers" real, "Number of Priests" real, "Number of Churches" real )
Name the name in syriac for 500 believers
SELECT "Name in Syriac" FROM table_26998 WHERE "Number of Believers" = '500'
CREATE TABLE table_23672 ( "Malayalam name" text, "Transliteration" text, "Concurrent Gregorian months" text, "Sanskrit word and meaning" text, "Zodiac sign" text )
Name the transliteration for
SELECT "Transliteration" FROM table_23672 WHERE "Malayalam name" = 'ചിങ്ങം'
CREATE TABLE table_203_374 ( id number, "rank" number, "nation" text, "gold" number, "silver" number, "bronze" number, "total" number )
who was the only nation with more total medals than belgium ?
SELECT "nation" FROM table_203_374 WHERE "total" > (SELECT "total" FROM table_203_374 WHERE "nation" = 'belgium')
CREATE TABLE table_42849 ( "Year" real, "Chassis" text, "Engine" text, "Start" real, "Finish" real, "Entrant" text )
What is the lowest finish that has a start greater than 27, with a year after 1985?
SELECT MIN("Finish") FROM table_42849 WHERE "Start" > '27' AND "Year" > '1985'
CREATE TABLE table_72201 ( "Chart" text, "Date of Entry" text, "Entry Position" real, "Peak Position" real, "Weeks on Peak" real, "Weeks on Chart" real, "Date of Exit" text )
What is the exit date for the Dutch Albums Top 100 Chart?
SELECT "Date of Exit" FROM table_72201 WHERE "Chart" = 'Dutch Albums Top 100'
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 transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype tex...
what were the five most frequent drugs prescribed during the same hospital encounter to the patients aged 50s after they had been diagnosed with hyposmolality, in this year?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_...
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 ) ...
specify the maximum duration of hospital stay for patients with angioedema as primary disease
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "ANGIOEDEMA"
CREATE TABLE SuggestedEditVotes ( Id number, SuggestedEditId number, UserId number, VoteTypeId number, CreationDate time, TargetUserId number, TargetRepChange number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDa...
Number of authors per answer (non-CW). Distribution of the number of co-authors per answer (excluding community wiki)
WITH TotalAnswers AS (SELECT CAST(COUNT(*) AS FLOAT) AS Count FROM Posts WHERE PostTypeId = 2 AND CommunityOwnedDate IS NULL) SELECT a.Authors AS "authors", COUNT(*) AS "answers", ROUND(COUNT(*) / (SELECT Count FROM TotalAnswers) * 100, 1) AS "percent" FROM (SELECT PostId, COUNT(DISTINCT UserId) AS "authors" FROM PostH...
CREATE TABLE table_name_53 ( package_option VARCHAR, content VARCHAR )
What is the package/option for the calcio content?
SELECT package_option FROM table_name_53 WHERE content = "calcio"
CREATE TABLE table_40733 ( "Year" real, "Chart" text, "Track" text, "Peak" real, "Weeks on Chart" real )
When the Track is ESO, the peak is smaller than 25, and the year is larger than 2004, what is the total number of Weeks on Chart?
SELECT COUNT("Weeks on Chart") FROM table_40733 WHERE "Track" = 'eso' AND "Peak" < '25' AND "Year" > '2004'
CREATE TABLE table_33535 ( "Network" text, "Origin of Programming" text, "Language" text, "Genre" text, "Service" text )
Which network has an origina of Programming in India, a general genre, a service of bell fibe tv, and tamil as its language?
SELECT "Network" FROM table_33535 WHERE "Origin of Programming" = 'india' AND "Genre" = 'general' AND "Service" = 'bell fibe tv' AND "Language" = 'tamil'
CREATE TABLE table_46684 ( "Player" text, "Games Played" real, "Minutes Played" real, "Minutes Played Per Game" real, "Rebounds" real, "Rebounds Per Game" real, "Assists" real, "Assists Per Game" real, "Field Goal %" real, "Free Throw %" real, "Points" real, "Points Per G...
What is the total number of Field Goal %, when Free Throw % is greater than 0.5, when Rebounds is 159, and when Points Per Game is less than 7.1?
SELECT COUNT("Field Goal %") FROM table_46684 WHERE "Free Throw %" > '0.5' AND "Rebounds" = '159' AND "Points Per Game" < '7.1'
CREATE TABLE table_46240 ( "Season" text, "Episodes" real, "Season premiere" text, "Season finale" text, "Peak Series rating[ citation needed ]" text, "Average series rating" text, "DVD release date" text, "Discs" real )
Which show has a season premiere with a Average series rating of 1.85 million viewers?
SELECT "Season premiere" FROM table_46240 WHERE "Average series rating" = '1.85 million viewers'
CREATE TABLE table_26173058_2 ( × VARCHAR, jeel VARCHAR, ramtha VARCHAR )
what the team where the record is 1-1 and the player is 1-1
SELECT × FROM table_26173058_2 WHERE jeel = "1-1" AND ramtha = "1-1"
CREATE TABLE table_name_81 ( opponents VARCHAR, partner VARCHAR )
Who was Manuela Maleeva opponent when she played a match partnered with michelle strebel?
SELECT opponents FROM table_name_81 WHERE partner = "michelle strebel"
CREATE TABLE fare_basis ( fare_basis_code text, booking_class text, class_type text, premium text, economy text, discounted text, night text, season text, basis_days text ) CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, ...
what is the round trip THRIFT fare on US from BOSTON to SAN FRANCISCO
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE (((flight.airline_code = 'US') AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN FRANCISCO' AND flight.to...
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 headquarter and the sum of price , and group by attribute headquarter, and visualize them by a bar chart, order by the x axis in descending please.
SELECT Headquarter, SUM(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter ORDER BY Headquarter DESC
CREATE TABLE table_name_88 ( royal_house VARCHAR, name VARCHAR )
Which royal house has the name huai?
SELECT royal_house FROM table_name_88 WHERE name = "huai"
CREATE TABLE table_name_81 ( week_2 VARCHAR, week_1 VARCHAR )
What Week 2 that has a Week 1 of mackenzie ryan?
SELECT week_2 FROM table_name_81 WHERE week_1 = "mackenzie ryan"
CREATE TABLE table_1965650_3 ( nhl_team VARCHAR, player VARCHAR )
Name the nhl times for jeff jacques
SELECT nhl_team FROM table_1965650_3 WHERE player = "Jeff Jacques"
CREATE TABLE table_61730 ( "Result" text, "Record" text, "Opponent" text, "Method" text, "Location" text )
What is the record when the method is decision and the location is Martigues, France?
SELECT "Record" FROM table_61730 WHERE "Method" = 'decision' AND "Location" = 'martigues, france'
CREATE TABLE table_57542 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
Which constructor had a grid number of less than 3 and where the Time/Retired was 1:34:31.522?
SELECT "Constructor" FROM table_57542 WHERE "Grid" < '3' AND "Time/Retired" = '1:34:31.522'
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 demographic ...
Specify name and route of administration of SYRG1.
SELECT prescriptions.drug, prescriptions.route FROM prescriptions WHERE prescriptions.formulary_drug_cd = "SYRG1"
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Effectiveness of What Have You Tried.
SELECT COUNT(c.PostId) AS QuestionCount, COUNT(a.Id) AS AnswerCount_ByCommenter, SUM(CASE WHEN NOT p.ClosedDate IS NULL THEN 1 ELSE 0 END), AVG(p.AnswerCount) FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id LEFT JOIN Posts AS a ON p.Id = a.Id AND a.OwnerUserId = c.UserId WHERE c.Text LIKE '%WhatHaveYouTried...
CREATE TABLE table_68678 ( "Year" text, "Title" text, "( Title in English )" text, "Director" text, "Character" text )
What is the title of the TV series with a character of Sheyda/Ashraf?
SELECT "Title" FROM table_68678 WHERE "Character" = 'sheyda/ashraf'
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...
count the number of patients whose days of hospital stay is greater than 3 and lab test name is pco2?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.days_stay > "3" AND lab.label = "pCO2"
CREATE TABLE table_70073 ( "Home Run" real, "Game" real, "Date" text, "Inning" text, "Location" text, "Opposing Pitcher" text, "Team" text )
Which team has a Home Run of 27?
SELECT "Team" FROM table_70073 WHERE "Home Run" = '27'
CREATE TABLE table_name_66 ( opposition VARCHAR, score VARCHAR, round VARCHAR, competition VARCHAR )
What is the Opposition in the First Round of the UEFA Cup with a Score of 3 1 (h), 2 0 (a)?
SELECT opposition FROM table_name_66 WHERE round = "first round" AND competition = "uefa cup" AND score = "3–1 (h), 2–0 (a)"
CREATE TABLE table_35936 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
Which player had a round of 27?
SELECT "Player" FROM table_35936 WHERE "Round" = '27'
CREATE TABLE table_9827 ( "Model number" text, "sSpec number" text, "Frequency" text, "GPU frequency" text, "L2 cache" text, "I/O bus" text, "Memory" text, "Voltage" text, "Socket" text, "Release date" text, "Part number(s)" text )
What is Frequency, when Part Number(s) is au80610006240aa?
SELECT "Frequency" FROM table_9827 WHERE "Part number(s)" = 'au80610006240aa'
CREATE TABLE table_64822 ( "Name (pinyin)" text, "Name (Wade Giles)" text, "Characters" text, "Type" text, "Construction" text )
Who has a Construction of 1873, foochow navy yard?
SELECT "Characters" FROM table_64822 WHERE "Construction" = '1873, foochow navy yard'
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE companies ( id number, name text, headquarters text, industry text, sales_billion number, profits_billion number, assets_billion number, market_val...
List the names of companies in descending order of market value.
SELECT name FROM companies ORDER BY market_value_billion DESC
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,...
count the number of patients whose admission type is elective and procedure long title is cardiopulmonary resuscitation, not otherwise specified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND procedures.long_title = "Cardiopulmonary resuscitation, not otherwise specified"
CREATE TABLE table_name_26 ( original_name VARCHAR, film_title_used_in_nomination VARCHAR )
What is the real name of the movie about love?
SELECT original_name FROM table_name_26 WHERE film_title_used_in_nomination = "love"
CREATE TABLE table_26996293_7 ( position VARCHAR, player VARCHAR )
What is the position of the player bill simmons?
SELECT position FROM table_26996293_7 WHERE player = "Bill Simmons"
CREATE TABLE table_203_382 ( id number, "date" text, "opponent" text, "site" text, "result" text )
what were the number of wins in the month of october ?
SELECT COUNT(*) FROM table_203_382 WHERE "result" = 'w' AND "date" = 10
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 for each home team and group by away team in a stacked bar chart The x-axis is home team, and order in asc by the names.
SELECT Home_team, COUNT(Home_team) FROM game GROUP BY Away_team, Home_team ORDER BY Home_team
CREATE TABLE table_name_52 ( city_state VARCHAR, status VARCHAR )
Which city/state was associated with a contestant whose status was 2nd runner-up?
SELECT city_state FROM table_name_52 WHERE status = "2nd runner-up"