instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Which game site(s) had record of 2-2?
CREATE TABLE table_54386 ("Week" text,"Date" text,"Opponent" text,"Result" text,"Kickoff [a ]" text,"Game site" text,"Attendance" text,"Record" text)
SELECT "Game site" FROM table_54386 WHERE "Record" = '2-2'
Among all the claims, which claims have a claimed amount larger than the average? List the date the claim was made and the date it was settled.
CREATE TABLE Claims (Date_Claim_Made VARCHAR,Date_Claim_Settled VARCHAR,Amount_Claimed INTEGER)
SELECT Date_Claim_Made, Date_Claim_Settled FROM Claims WHERE Amount_Claimed > (SELECT AVG(Amount_Claimed) FROM Claims)
What is the value in 2006 when the value for 2009 is 0 with runner-ups for tournament?
CREATE TABLE table_name_72 (tournament VARCHAR)
SELECT 2006 FROM table_name_72 WHERE 2009 = "0" AND tournament = "runner-ups"
Tell me the loewst assume office for madeleine bordallo
CREATE TABLE table_name_60 (assumed_office INTEGER,name VARCHAR)
SELECT MIN(assumed_office) FROM table_name_60 WHERE name = "madeleine bordallo"
Draw a bar chart of last name versus department_id, and order from low to high by the X.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),E...
SELECT LAST_NAME, DEPARTMENT_ID FROM employees ORDER BY LAST_NAME
Give me the comparison about the sum of Team_ID over the ACC_Road , and group by attribute ACC_Road, list in desc by the Y please.
CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)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_Perce...
SELECT ACC_Road, SUM(Team_ID) FROM basketball_match GROUP BY ACC_Road ORDER BY SUM(Team_ID) DESC
Which club has Jamie Korab as Lead?
CREATE TABLE table_name_69 (club VARCHAR,lead VARCHAR)
SELECT club FROM table_name_69 WHERE lead = "jamie korab"
when did patient 15107 enter for the first time in the hospital since 2104?
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE admissions (row_id number,subject_id number,hadm_id...
SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 15107 AND STRFTIME('%y', admissions.admittime) >= '2104' ORDER BY admissions.admittime LIMIT 1
what is religion and date of death of subject id 74032?
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 demographic (subject_id text,hadm_id text,name text,marital_status text,age text,do...
SELECT demographic.religion, demographic.dod FROM demographic WHERE demographic.subject_id = "74032"
Which district has a retired republican hold and an incumbent of rufus p. spalding?
CREATE TABLE table_5539 ("District" text,"Incumbent" text,"Party" text,"First elected" text,"Result" text)
SELECT "District" FROM table_5539 WHERE "Result" = 'retired republican hold' AND "Incumbent" = 'rufus p. spalding'
On what date did the home team score 14.12 (96)?
CREATE TABLE table_20734 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Crowd" real,"Date" text,"Time" text)
SELECT "Date" FROM table_20734 WHERE "Home team score" = '14.12 (96)'
What round was the method submission (punches)?
CREATE TABLE table_name_18 (round VARCHAR,method VARCHAR)
SELECT COUNT(round) FROM table_name_18 WHERE method = "submission (punches)"
What was the score of the game when the record was 35-47?
CREATE TABLE table_name_76 (score VARCHAR,record VARCHAR)
SELECT score FROM table_name_76 WHERE record = "35-47"
What is the Notes of the Frequency with Format of talk radio?
CREATE TABLE table_42684 ("Frequency" text,"Call sign" text,"Format" text,"Owner" text,"Notes" text)
SELECT "Notes" FROM table_42684 WHERE "Format" = 'talk radio'
What was the miles (km) for the race that had an average speed of 136.117 MPH?
CREATE TABLE table_2220432_1 (miles__km_ VARCHAR,average_speed__mph_ VARCHAR)
SELECT miles__km_ FROM table_2220432_1 WHERE average_speed__mph_ = "136.117"
What is the candidates for first elected 1914
CREATE TABLE table_784 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text)
SELECT "Candidates" FROM table_784 WHERE "First elected" = '1914'
What was Sherrick McManis's earliest round?
CREATE TABLE table_73244 ("Round #" real,"Pick #" real,"NFL Team" text,"Player" text,"Position" text,"College" text)
SELECT MIN("Round #") FROM table_73244 WHERE "Player" = 'Sherrick McManis'
All-uppercase Stack Overflow questions asked in the last three days.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,Clo...
SELECT PostId AS "post_link", 'http://stackoverflow.com/posts/' + CAST(p.Id AS TEXT(100)) + '/revisions', Text FROM PostHistory AS ph JOIN Posts AS p ON p.Id = ph.PostId WHERE PostHistoryTypeId = 2 AND Text = UPPER(Text) COLLATE SQL_Latin1_General_CP1_CS_AS AND ph.CreationDate > (SELECT CreationDate FROM Posts WHERE Id...
Which Score has a Place of t5, and a Country of united states?
CREATE TABLE table_58744 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text,"Money (\u00a3)" real)
SELECT "Score" FROM table_58744 WHERE "Place" = 't5' AND "Country" = 'united states'
until 1 year ago what were the four most frequent diagnoses that were given to patients within 2 months after the diagnosis of pulmonary collapse?
CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE pres...
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions...
have patient 013-27480 had a diagnosis this year?
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 medication (medicationid number,patientunitstayid number,drugname text,dos...
SELECT COUNT(*) > 0 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '013-27480')) AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETI...
What Car Model has the Engine of Ford 6.0 V8?
CREATE TABLE table_38379 ("Team" text,"Manufacturer" text,"Car model" text,"Engine" text,"Driver" text)
SELECT "Car model" FROM table_38379 WHERE "Engine" = 'ford 6.0 v8'
flight from DENVER to PHILADELPHIA
CREATE TABLE time_zone (time_zone_code text,time_zone_name text,hours_from_gmt int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE code_description (code varchar,description text)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DENVER' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADE...
Find names of all students who took some course and the course description.
CREATE TABLE student (stu_fname VARCHAR,stu_lname VARCHAR,stu_num VARCHAR)CREATE TABLE enroll (stu_num VARCHAR,class_code VARCHAR)CREATE TABLE course (crs_description VARCHAR,crs_code VARCHAR)CREATE TABLE CLASS (class_code VARCHAR,crs_code VARCHAR)
SELECT T1.stu_fname, T1.stu_lname, T4.crs_description FROM student AS T1 JOIN enroll AS T2 ON T1.stu_num = T2.stu_num JOIN CLASS AS T3 ON T2.class_code = T3.class_code JOIN course AS T4 ON T3.crs_code = T4.crs_code
Bar chart x axis competition y axis the total number
CREATE TABLE match (Match_ID int,Date text,Venue text,Score text,Result text,Competition text)CREATE TABLE city (City_ID int,City text,Hanzi text,Hanyu_Pinyin text,Regional_Population int,GDP real)CREATE TABLE temperature (City_ID int,Jan real,Feb real,Mar real,Apr real,Jun real,Jul real,Aug real,Sep real,Oct real,Nov ...
SELECT Competition, COUNT(*) FROM match GROUP BY Competition
compared to measured at 2102-06-29 10:30:00 was the glucose value of patient 025-53910 less than the value measured at 2102-06-27 10:36:00?
CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE diagnosis (diagnosi...
SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-53910')) AND lab.labname = 'glucose' AND lab.labresulttime = '2102-06-29 10...
Who will teach MICRBIOL 641 next semester ?
CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE course (course...
SELECT DISTINCT instructor.name FROM instructor INNER JOIN offering_instructor ON offering_instructor.instructor_id = instructor.instructor_id INNER JOIN course_offering ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN course ON course.course_id = course_offering.course_id INNER JOIN semester...
show me the flights available from SAN FRANCISCO to PITTSBURGH for tuesday and also the price
CREATE TABLE days (days_code varchar,day_name varchar)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 equipment_sequence (aircraft_code_sequence varchar,aircraft_code varchar)CREATE TABLE aircr...
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, days AS DAYS_1, fare, fare_basis, flight, flight_fare WHERE (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AN...
list the ids of the patients diagnosed with malfunc card dev/grf nec since 2102.
CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABL...
SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'malfunc card dev/grf nec') AND STRFTIME('%y', diagnoses_icd.charttime) >= ...
Which site/stadium was the score 1-2?
CREATE TABLE table_name_78 (site_stadium VARCHAR,score VARCHAR)
SELECT site_stadium FROM table_name_78 WHERE score = "1-2"
Who was the Semi-Finalist #2 in 2001?
CREATE TABLE table_57216 ("Year" text,"Champion" text,"Score" text,"Runner-Up" text,"Location" text,"Semi-Finalist #1" text,"Semi-Finalist #2" text)
SELECT "Semi-Finalist #2" FROM table_57216 WHERE "Year" = '2001'
calculate the dose of impact that patient 7519 received until 1785 days ago.
CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,cost number)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_items (row_id number,itemid number,label t...
SELECT SUM(inputevents_cv.amount) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 7519)) AND inputevents_cv.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.labe...
What is the name of the home team that played away team Footscray?
CREATE TABLE table_name_46 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_46 WHERE away_team = "footscray"
How many seats in 2006 has a % 1997 rating of 38.9?
CREATE TABLE table_21132404_1 (seats_2006 VARCHAR,_percentage_1997 VARCHAR)
SELECT COUNT(seats_2006) FROM table_21132404_1 WHERE _percentage_1997 = "38.9"
What is the average Games Played for Bo Oshoniyi, who had more than 1170 minutes and 10 loses?
CREATE TABLE table_70245 ("Player" text,"Club" text,"Games Played" real,"Minutes" real,"Goals Against" real,"GA Average" real,"Wins" real,"Loses" real)
SELECT AVG("Games Played") FROM table_70245 WHERE "Loses" = '10' AND "Player" = 'bo oshoniyi' AND "Minutes" > '1170'
how many patients are tested with lab item id 50922?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50922"
What is Show, when Episode Number is 1, when Year is less than 2010, and when Original Airdate is January 20, 2008?
CREATE TABLE table_46368 ("Year" real,"Show" text,"Season" real,"Episode" text,"Episode number" real,"Original airdate" text)
SELECT "Show" FROM table_46368 WHERE "Episode number" = '1' AND "Year" < '2010' AND "Original airdate" = 'january 20, 2008'
What team is sponsored by w.h. bolin?
CREATE TABLE table_name_14 (team VARCHAR,sponsor VARCHAR)
SELECT team FROM table_name_14 WHERE sponsor = "w.h. bolin"
All questions with a *single* tag and a *word* in Title.
CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance t...
SELECT Id AS "post_link" FROM Posts WHERE PostTypeId = 1 AND Tags = CONCAT('<', '##Tag:string##', '>') AND UPPER(Title) LIKE UPPER('%##word##%') ORDER BY CreationDate
Give me a bar chart to show the revenue of the company that earns the highest revenue in each headquarter city, I want to show names in asc order.
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)
SELECT Headquarter, MAX(Revenue) FROM Manufacturers GROUP BY Headquarter ORDER BY Headquarter
give me the number of patients whose admission location is phys referral/normal deli and year of death is less than or equal to 2148?
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 text,icustay_id text,drug_type text,drug text,formulary_drug_cd t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.dod_year <= "2148.0"
Who was the home team when Fitzroy was the away team?
CREATE TABLE table_name_76 (home_team VARCHAR,away_team VARCHAR)
SELECT home_team FROM table_name_76 WHERE away_team = "fitzroy"
How many points on average are there for less than 5 games played?
CREATE TABLE table_name_84 (points INTEGER,games_played INTEGER)
SELECT AVG(points) FROM table_name_84 WHERE games_played < 5
What is Domenik Hixon's average rush?
CREATE TABLE table_name_76 (avg VARCHAR,player VARCHAR)
SELECT avg FROM table_name_76 WHERE player = "domenik hixon"
how many institutions were founded before 1950 ?
CREATE TABLE table_203_135 (id number,"institution" text,"location" text,"founded" number,"type" text,"enrollment" number,"joined" number,"nickname" text)
SELECT COUNT("institution") FROM table_203_135 WHERE "founded" < 1950
Who were the original artist(s) on harder to breathe?
CREATE TABLE table_28715942_2 (original_artist VARCHAR,track VARCHAR)
SELECT original_artist FROM table_28715942_2 WHERE track = "Harder To Breathe"
What was the attendance on week 1?
CREATE TABLE table_name_41 (attendance VARCHAR,week VARCHAR)
SELECT attendance FROM table_name_41 WHERE week = 1
How many different cities are they from?
CREATE TABLE person (name text,age number,city text,gender text,job text)CREATE TABLE personfriend (name text,friend text,year number)
SELECT COUNT(DISTINCT city) FROM person
Which rank's country is the US when the accolade is 40 best albums of the year?
CREATE TABLE table_name_96 (rank VARCHAR,country VARCHAR,accolade VARCHAR)
SELECT rank FROM table_name_96 WHERE country = "us" AND accolade = "40 best albums of the year"
calculate the number of unmarried patients who had a lab test for oxygen saturation.
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,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "SINGLE" AND lab.label = "Oxygen Saturation"
Which room has the highest rate? List the room's full name, rate, check in and check out date.
CREATE TABLE Rooms (roomName VARCHAR,RoomId VARCHAR)CREATE TABLE Reservations (Rate VARCHAR,CheckIn VARCHAR,CheckOut VARCHAR,Room VARCHAR)
SELECT T2.roomName, T1.Rate, T1.CheckIn, T1.CheckOut FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY T1.Rate DESC LIMIT 1
tell me the number of patients on base drug prescription who have procedure icd9 code 5771.
CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)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...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE procedures.icd9_code = "5771" AND prescriptions.drug_type = "BASE"
Return the average price for each product type Visualize by bar chart, I want to sort in desc by the Y.
CREATE TABLE Department_Stores (dept_store_id INTEGER,dept_store_chain_id INTEGER,store_name VARCHAR(80),store_address VARCHAR(255),store_phone VARCHAR(80),store_email VARCHAR(80))CREATE TABLE Department_Store_Chain (dept_store_chain_id INTEGER,dept_store_chain_name VARCHAR(80))CREATE TABLE Supplier_Addresses (supplier...
SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY AVG(product_price) DESC
what was the largest gf in team history in the arab nations cup ?
CREATE TABLE table_202_197 (id number,"year" number,"round" number,"gp" number,"w" number,"d" number,"l" number,"gf" number,"ga" number)
SELECT MAX("gf") FROM table_202_197
which song was released earlier -- sister mary or run to me ?
CREATE TABLE table_204_742 (id number,"release date" text,"single title" text,"uk singles chart\nposition" number,"french\ncharts" number,"german\ncharts" number,"irish\ncharts" number,"various" text)
SELECT "single title" FROM table_204_742 WHERE "single title" IN ('"sister mary" (duet with joe dolan)', '"run to me"') ORDER BY "release date" LIMIT 1
What year was the championship in Wimbledon (2)?
CREATE TABLE table_1028356_3 (year VARCHAR,championship VARCHAR)
SELECT year FROM table_1028356_3 WHERE championship = "Wimbledon (2)"
until 3 years ago how many patients have had a blood culture ( myco/f lytic bottle) test performed?
CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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 procedures_icd (...
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT microbiologyevents.hadm_id FROM microbiologyevents WHERE microbiologyevents.spec_type_desc = 'blood culture ( myco/f lytic bottle)' AND DATETIME(microbiologyevents.charttime) <= DATETIME(CURRENT_TIME(), '-3 year'))
What is the home town of David Noel?
CREATE TABLE table_23924 ("Name" text,"#" real,"Height" text,"Weight" real,"Position" text,"Year" text,"Home Town" text,"High School" text)
SELECT "Home Town" FROM table_23924 WHERE "Name" = 'David Noel'
Who had notes of Prizzi's Honor?
CREATE TABLE table_name_72 (director VARCHAR,notes VARCHAR)
SELECT director FROM table_name_72 WHERE notes = "prizzi's honor"
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of phone_number and manager_id , and order by the bars in ascending.
CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGER_ID decimal(6,0),DEPARTMENT_ID decimal(4,0))CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE va...
SELECT PHONE_NUMBER, MANAGER_ID FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY PHONE_NUMBER
Name the score for 7 may 2000
CREATE TABLE table_78478 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text)
SELECT "Score" FROM table_78478 WHERE "Date" = '7 may 2000'
Which Major League Soccer team for the 2005 season has the lowest goals?
CREATE TABLE table_56600 ("Season" text,"Club" text,"League" text,"Apps." real,"Goals" real)
SELECT MIN("Goals") FROM table_56600 WHERE "League" = 'major league soccer' AND "Season" = '2005'
Name the minimum kerry # for bush % for 50.9%
CREATE TABLE table_21577 ("County" text,"Kerry%" text,"Kerry#" real,"Bush%" text,"Bush#" real,"Others%" text,"Others#" real)
SELECT MIN("Kerry#") FROM table_21577 WHERE "Bush%" = '50.9%'
What is the lowest total when the Bronze metals are larger than 0 and the nation is France (fra)?
CREATE TABLE table_53764 ("Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT MIN("Total") FROM table_53764 WHERE "Bronze" > '0' AND "Nation" = 'france (fra)'
When is the first broadcast for episodes where Rufus's guest is Jack Whitehall?
CREATE TABLE table_2194 ("Episode" text,"First broadcast" text,"Rufus guest" text,"Marcus guest" text,"Winner" text)
SELECT "First broadcast" FROM table_2194 WHERE "Rufus guest" = 'Jack Whitehall'
What is the max torque of model 1.4 16v?
CREATE TABLE table_52266 ("model" text,"cylinders/ valves" text,"displacement cc" real,"max. power kW (PS) at rpm" text,"max. torque (Nm) at rpm" text,"engine code" text,"top speed (km/h)" real,"production period" text)
SELECT "max. torque (Nm) at rpm" FROM table_52266 WHERE "model" = '1.4 16v'
Am I able to take 452 on Mondays and Wednesdays ?
CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester i...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
Bar chart x axis card type code y axis the total number, and display by the y-axis from high to low please.
CREATE TABLE Customers_Cards (card_id INTEGER,customer_id INTEGER,card_type_code VARCHAR(15),card_number VARCHAR(80),date_valid_from DATETIME,date_valid_to DATETIME,other_card_details VARCHAR(255))CREATE TABLE Accounts (account_id INTEGER,customer_id INTEGER,account_name VARCHAR(50),other_account_details VARCHAR(255))C...
SELECT card_type_code, COUNT(*) FROM Customers_Cards GROUP BY card_type_code ORDER BY COUNT(*) DESC
What are the first names, office locations, and departments of all instructors, and also what are the descriptions of the courses they teach?
CREATE TABLE employee (emp_num number,emp_lname text,emp_fname text,emp_initial text,emp_jobcode text,emp_hiredate time,emp_dob time)CREATE TABLE course (crs_code text,dept_code text,crs_description text,crs_credit number)CREATE TABLE department (dept_code text,dept_name text,school_code text,emp_num number,dept_addres...
SELECT T2.emp_fname, T4.prof_office, T3.crs_description, T5.dept_name FROM class AS T1 JOIN employee AS T2 ON T1.prof_num = T2.emp_num JOIN course AS T3 ON T1.crs_code = T3.crs_code JOIN professor AS T4 ON T2.emp_num = T4.emp_num JOIN department AS T5 ON T4.dept_code = T5.dept_code
what is the highest number where people got done at 31.1
CREATE TABLE table_1354805_6 (competition_finish INTEGER,average VARCHAR)
SELECT MAX(competition_finish) FROM table_1354805_6 WHERE average = "31.1"
Find the category descriptions of the products whose descriptions include letter 't'.
CREATE TABLE ref_product_categories (product_category_description VARCHAR,product_category_code VARCHAR)CREATE TABLE products (product_category_code VARCHAR,product_description VARCHAR)
SELECT T1.product_category_description FROM ref_product_categories AS T1 JOIN products AS T2 ON T1.product_category_code = T2.product_category_code WHERE T2.product_description LIKE '%t%'
How many of my answers were accepted on different days.
CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text...
SELECT Votes.CreationDate, COUNT(*) AS Num FROM Posts INNER JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId AND Votes.VoteTypeId = 1 GROUP BY Votes.CreationDate ORDER BY Votes.CreationDate
When did the show directed by Michael Dimartino first air?
CREATE TABLE table_19530 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text)
SELECT "Original air date" FROM table_19530 WHERE "Directed by" = 'Michael DiMartino'
Name the home team for football park
CREATE TABLE table_20747 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Ground" text,"Date" text,"Crowd" real)
SELECT "Home team" FROM table_20747 WHERE "Ground" = 'Football Park'
Give me the times and numbers of all trains that go to Chennai.
CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,interval text)CREATE TABLE route (train_id int,station_id int)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,l...
SELECT time, train_number FROM train WHERE destination = 'Chennai'
What is the goals for when played is larger than 30?
CREATE TABLE table_79026 ("Position" real,"Club" text,"Played" real,"Points" real,"Wins" real,"Draws" real,"Losses" real,"Goals for" real,"Goals against" real,"Goal Difference" real)
SELECT MIN("Goals for") FROM table_79026 WHERE "Played" > '30'
In what former province was the area 694.9 kilometers squared?
CREATE TABLE table_20665 ("Code" real,"County" text,"Former Province" text,"Area (km 2)" text,"Population Census 2009" real,"Capital" text)
SELECT "Former Province" FROM table_20665 WHERE "Area (km 2 )" = '694.9'
which game had the most attendance ?
CREATE TABLE table_203_344 (id number,"#" number,"date" text,"opponent" text,"score" text,"win" text,"loss" text,"save" text,"attendance" number,"record" text,"other info" text)
SELECT "#" FROM table_203_344 ORDER BY "attendance" DESC LIMIT 1
What is the final score when 22210 is the attendance?
CREATE TABLE table_23612439_2 (final_score VARCHAR,attendance VARCHAR)
SELECT final_score FROM table_23612439_2 WHERE attendance = 22210
what is the difference of the number of won games between stade toulousain and ca brive ?
CREATE TABLE table_203_322 (id number,"club" text,"played" number,"won" number,"drawn" number,"lost" number,"points for" number,"points against" number,"bonus points" number,"points" number)
SELECT (SELECT "won" FROM table_203_322 WHERE "club" = 'stade toulousain') - (SELECT "won" FROM table_203_322 WHERE "club" = 'ca brive')
Name the most share for 2.76 million viewers
CREATE TABLE table_22822468_2 (share INTEGER,viewers__millions_ VARCHAR)
SELECT MAX(share) FROM table_22822468_2 WHERE viewers__millions_ = "2.76"
tell me the cost of a protein - csf lab test.
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 number,wardid number,admissionheight number,admissionweight number...
SELECT DISTINCT cost.cost FROM cost WHERE cost.eventtype = 'lab' AND cost.eventid IN (SELECT lab.labid FROM lab WHERE lab.labname = 'protein - csf')
Return the hispanic percentage for cities in which the black percentage is greater than 10.
CREATE TABLE city (city_id number,county_id number,name text,white number,black number,amerindian number,asian number,multiracial number,hispanic number)CREATE TABLE county_public_safety (county_id number,name text,population number,police_officers number,residents_per_officer number,case_burden number,crime_rate numbe...
SELECT hispanic FROM city WHERE black > 10
what flights do you have from BOSTON to PITTSBURGH on wednesday of next week after 1800
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE airline (airline_code varchar,airline_name text,note text)CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE c...
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 ((date_day.day_number = 23 AND date_day.month_number = 4 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight.departure_time...
what opponent is below belgium ?
CREATE TABLE table_204_52 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text)
SELECT "opponent" FROM table_204_52 WHERE id = (SELECT id FROM table_204_52 WHERE "opponent" = 'belgium') + 1
which team came in last place ?
CREATE TABLE table_203_30 (id number,"place" number,"team" text,"played" number,"won" number,"draw" number,"lost" number,"goals\nscored" number,"goals\nconceded" number,"+/-" number,"points" number)
SELECT "team" FROM table_203_30 ORDER BY "place" DESC LIMIT 1
provide the number of patients whose admission year is less than 2156 and item id is 51383?
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 (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2156" AND lab.itemid = "51383"
in the first hospital encounter what are the insurance names of patient 15135?
CREATE TABLE icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid number,intime time,outtime time)CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row...
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 15135 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1
Name the inducted as for joe medwick category:articles with hcards
CREATE TABLE table_19611329_1 (inducted_as VARCHAR,player VARCHAR)
SELECT inducted_as FROM table_19611329_1 WHERE player = "Joe Medwick Category:Articles with hCards"
count the number of patients who had lab test calculated tbg and died on or before 2148.
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)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.dod_year <= "2148.0" AND lab.label = "Calculated TBG"
Visualize a bar chart about the distribution of Days and the amount of Days , and group by attribute Days.
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Gradeconversion (lettergrade VARCHAR(2),gradepoint FLOAT)CREATE TABLE Minor_in (StuID INTEGER,DNO INTEGER)CREATE TABLE Course (CID VARCHAR(7),CName VARCHAR(4...
SELECT Days, COUNT(Days) FROM Course GROUP BY Days ORDER BY Credits
Record of 22 20 involved what score?
CREATE TABLE table_75025 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text)
SELECT "Score" FROM table_75025 WHERE "Record" = '22–20'
What is the vessel type for vessel operator Jumbo shipping?
CREATE TABLE table_26168687_3 (vessel_type VARCHAR,vessel_operator VARCHAR)
SELECT vessel_type FROM table_26168687_3 WHERE vessel_operator = "Jumbo Shipping"
what comes immediately after complete series 11 ?
CREATE TABLE table_203_461 (id number,"dvd title" text,"discs" number,"year" text,"no. of ep." number,"dvd release\nregion 2" text,"dvd release\nregion 4" text)
SELECT "dvd title" FROM table_203_461 WHERE id = (SELECT id FROM table_203_461 WHERE "dvd title" = 'complete series 11') + 1
what are the five most frequent specimen tests that patients had within 2 months after they had been diagnosed with abdom aortic aneurysm until 2100?
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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text...
SELECT t3.spec_type_desc FROM (SELECT t2.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime 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_...
When columbia, south carolina is the hometown what is the lowest age?
CREATE TABLE table_1859855_2 (age INTEGER,hometown VARCHAR)
SELECT MIN(age) FROM table_1859855_2 WHERE hometown = "Columbia, South Carolina"
50 most viewed questions on Ask Ubuntu on 2015-03-08.
CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE CloseReasonTypes (Id numb...
SELECT * FROM Posts, PostTypes WHERE Posts.PostTypeId = PostTypes.Id AND PostTypes.Id = 1 AND Posts.CreationDate BETWEEN '2015-03-08 00:00:00' AND '2015-03-08 23:59:59' ORDER BY Posts.ViewCount DESC LIMIT 50
What date(s) was the game(s) at Candlestick Park?
CREATE TABLE table_name_30 (date VARCHAR,venue VARCHAR)
SELECT date FROM table_name_30 WHERE venue = "candlestick park"
What Vancouver canucks game was on a date closest to November 4?
CREATE TABLE table_36443 ("Game" real,"November" real,"Opponent" text,"Score" text,"Record" text,"Points" real)
SELECT MAX("Game") FROM table_36443 WHERE "Opponent" = 'vancouver canucks' AND "November" < '4'
Name the wickets when overs bowled is 9
CREATE TABLE table_15700367_4 (wickets VARCHAR,overs_bowled VARCHAR)
SELECT wickets FROM table_15700367_4 WHERE overs_bowled = "9"