table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_24363 ( "Type of Record" text, "Attendance" real, "Date/Year" text, "Stadium" text, "Result/Games" text )
Which stadium had the result/game montreal 20 @ ottawa 10?
SELECT "Stadium" FROM table_24363 WHERE "Result/Games" = 'Montreal 20 @ Ottawa 10'
CREATE TABLE table_name_6 ( overall VARCHAR, position VARCHAR )
Name the total number of overall for defensive tackle
SELECT COUNT(overall) FROM table_name_6 WHERE position = "defensive tackle"
CREATE TABLE table_name_13 ( year INTEGER, entrant VARCHAR, pts VARCHAR )
What is the latest year that shadow racing team scored more than 0 points?
SELECT MAX(year) FROM table_name_13 WHERE entrant = "shadow racing team" AND pts > 0
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
how many patients whose insurance is medicaid and diagnoses long title is congestive heart failure, unspecified?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Medicaid" AND diagnoses.long_title = "Congestive heart failure, unspecified"
CREATE TABLE table_name_42 ( drawn INTEGER, first_game VARCHAR, played VARCHAR )
What is the total number of drawn matches from first game years before 2006 and fewer than 2 matches played?
SELECT SUM(drawn) FROM table_name_42 WHERE first_game < 2006 AND played < 2
CREATE TABLE table_68350 ( "Name" text, "Park" text, "Country" text, "Inversions" real, "Opened" text, "Status" text )
Name the sum of inversions for opened of april 20, 2002
SELECT SUM("Inversions") FROM table_68350 WHERE "Opened" = 'april 20, 2002'
CREATE TABLE table_1013129_2 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
How many different college/junior/club teams provided a player to the Washington Capitals NHL Team?
SELECT COUNT(college_junior_club_team) FROM table_1013129_2 WHERE nhl_team = "Washington Capitals"
CREATE TABLE table_name_87 ( total INTEGER, gold VARCHAR, bronze VARCHAR, rank VARCHAR )
What is the largest total for a team with 1 bronze, 0 gold medals and ranking of 7?
SELECT MAX(total) FROM table_name_87 WHERE bronze = 1 AND rank = "7" AND gold > 0
CREATE TABLE table_41024 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
Which Power has a CBLI Identifier?
SELECT "Power" FROM table_41024 WHERE "Identifier" = 'cbli'
CREATE TABLE table_train_206 ( "id" int, "gender" string, "pregnancy_or_lactation" bool, "systolic_blood_pressure_sbp" int, "hematocrit_hct" float, "diabetic" string, "contraception" bool, "diastolic_blood_pressure_dbp" int, "serum_creatinine" float, "NOUSE" float )
hematocrit > 34 % in female and > 35 % in male ;
SELECT * FROM table_train_206 WHERE (hematocrit_hct > 35 AND gender = 'male') OR (hematocrit_hct > 34 AND gender = 'female')
CREATE TABLE table_name_86 ( average INTEGER, swimsuit INTEGER )
What is the average of the contestant with a swimsuit less than 9.32?
SELECT SUM(average) FROM table_name_86 WHERE swimsuit < 9.32
CREATE TABLE table_74548 ( "Division" text, "League Apps" real, "League Goals" real, "FA Cup Apps" real, "FA Cup Goals" real, "Total Apps" real, "Total Goals" real )
The total goals have a FA Cup Apps larger than 1, and a Total Apps of 37, and a League Apps smaller than 30?, what is the total number?
SELECT COUNT("Total Goals") FROM table_74548 WHERE "FA Cup Apps" > '1' AND "Total Apps" = '37' AND "League Apps" < '30'
CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE prescriptions ( subject_id text, hadm_id...
what is the average age of patients with emergency admission and year of birth after 1821?
SELECT AVG(demographic.age) FROM demographic WHERE demographic.admission_type = "EMERGENCY" AND demographic.dob_year > "1821"
CREATE TABLE table_25042332_30 ( enrolled_women VARCHAR, e_vap_ratio_women VARCHAR )
what is the number of registered female voters where the percentage is 108.6%
SELECT enrolled_women FROM table_25042332_30 WHERE e_vap_ratio_women = "108.6%"
CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname var...
For HISTART 481 , what prerequisites have I fulfilled ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'HISTART' AND COURSE_1.number...
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 i...
tell me the name of the organism found on the last sputum, expectorated microbiology test of patient 031-15417 until 20 months ago?
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-15417')) AND microlab.culturesite = 'sputum, expectorated' AND DATETI...
CREATE TABLE table_40846 ( "Rank" real, "Name" text, "Years" text, "Matches" real, "Goals" real )
What is the average number of goals for players ranked above 9 and playing more than 205 matches?
SELECT AVG("Goals") FROM table_40846 WHERE "Matches" = '205' AND "Rank" > '9'
CREATE TABLE table_name_40 ( producer_director VARCHAR, film VARCHAR )
Who was the Producer/Director of Fear Beneath?
SELECT producer_director FROM table_name_40 WHERE film = "fear beneath"
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TA...
how many times has psychiatry consultation - suicide precautions been ordered?
SELECT COUNT(*) FROM treatment WHERE treatment.treatmentname = 'psychiatry consultation - suicide precautions'
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime...
tell me the top four of the most common intakes?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
CREATE TABLE table_name_96 ( total INTEGER, finish VARCHAR, country VARCHAR )
What is the average of Fiji with t10 Finish?
SELECT AVG(total) FROM table_name_96 WHERE finish = "t10" AND country = "fiji"
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 diagnoses ( ...
count the number of patients whose admission year is less than 2168 and drug route is inhalation?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2168" AND prescriptions.route = "INHALATION"
CREATE TABLE table_24736 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Slovak title" text, "Director" text, "Result" text )
HOw many films did martin repka category:articles with hcards direct?
SELECT COUNT("Film title used in nomination") FROM table_24736 WHERE "Director" = 'Martin Repka Category:Articles with hCards'
CREATE TABLE table_name_90 ( title VARCHAR, presentation_of_credentials VARCHAR )
What Title has a Presentation of Credentials of October 4, 1988?
SELECT title FROM table_name_90 WHERE presentation_of_credentials = "october 4, 1988"
CREATE TABLE table_name_4 ( sport VARCHAR, medal_count VARCHAR )
Which sport has 17 as the medal count?
SELECT sport FROM table_name_4 WHERE medal_count = 17
CREATE TABLE table_name_24 ( top_25 INTEGER, events INTEGER )
How many top-25s are associated with more than 91 events?
SELECT SUM(top_25) FROM table_name_24 WHERE events > 91
CREATE TABLE table_name_79 ( score VARCHAR, game VARCHAR )
What's the score of Game 5?
SELECT score FROM table_name_79 WHERE game = "5"
CREATE TABLE table_41674 ( "Poll Source" text, "Date(s) administered" text, "Sample size" real, "Margin of Error" text, "Mel Martinez (R)" text, "Betty Castor (D)" text )
What is the highest sample size administered on October 18?
SELECT MAX("Sample size") FROM table_41674 WHERE "Date(s) administered" = 'october 18'
CREATE TABLE district ( District_ID int, District_name text, Headquartered_City text, City_Population real, City_Area real ) CREATE TABLE store_product ( Store_ID int, Product_ID int ) CREATE TABLE store ( Store_ID int, Store_Name text, Type text, Area_size real, Number...
Find all types of store and number of them Visualize by bar chart, rank by the y axis in descending please.
SELECT Type, COUNT(*) FROM store GROUP BY Type ORDER BY COUNT(*) DESC
CREATE TABLE table_38089 ( "Week" real, "Date" text, "Opponent" text, "Location" text, "Time ( ET )" text, "Result" text, "Record" text )
Which Record has a Time (ET) of 1:00pm, and an Opponent of kansas city chiefs?
SELECT "Record" FROM table_38089 WHERE "Time ( ET )" = '1:00pm' AND "Opponent" = 'kansas city chiefs'
CREATE TABLE table_79617 ( "Player" text, "Played" real, "Legs Won" real, "Legs Lost" real, "100+" real, "140+" real, "180s" real, "High Checkout" real, "3-dart Average" real )
What is the high checkout when Legs Won is smaller than 9, a 180s of 1, and a 3-dart Average larger than 88.36?
SELECT SUM("High Checkout") FROM table_79617 WHERE "Legs Won" < '9' AND "180s" = '1' AND "3-dart Average" > '88.36'
CREATE TABLE table_name_15 ( to_par VARCHAR, score VARCHAR )
What To par has a Score of 68-66=134?
SELECT to_par FROM table_name_15 WHERE score = 68 - 66 = 134
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 job_history ( EMPLOYEE_ID decimal(6,0...
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, give me the comparison about the sum of salary over the job_id , and group by attribute job_id by a bar chart.
SELECT JOB_ID, SUM(SALARY) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 GROUP BY JOB_ID
CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE ground_service ( city_code text, airport_code text, tr...
DL flights from SAN FRANCISCO please
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 = 'SAN FRANCISCO' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND flight.from_airport...
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, ...
what is the number of patients with drug code warf2 who were tested for other body fluids in the fluid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE prescriptions.formulary_drug_cd = "WARF2" AND lab.fluid = "Other Body Fluid"
CREATE TABLE table_name_12 ( year INTEGER, team VARCHAR, wins VARCHAR )
When is the earliest year associated with team norton and 0 wins?
SELECT MIN(year) FROM table_name_12 WHERE team = "norton" AND wins < 0
CREATE TABLE table_36593 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text, "Attendance" real )
On December 5 what team played their home game?
SELECT "Home" FROM table_36593 WHERE "Date" = 'december 5'
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END...
For those employees who did not have any job in the past, give me the comparison about the average of manager_id over the job_id , and group by attribute job_id, and display Y-axis in asc order.
SELECT JOB_ID, AVG(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY AVG(MANAGER_ID)
CREATE TABLE table_16423 ( "Location" text, "Monday" text, "Tuesday" text, "Wednesday" text, "Thursday" text, "Friday" text, "Saturday" text, "Sunday" text )
what's the wednesday time with monday being 10:00-8:00
SELECT "Wednesday" FROM table_16423 WHERE "Monday" = '10:00-8:00'
CREATE TABLE table_7416 ( "Tournament" text, "1995" text, "1996" text, "1997" text, "1998" text, "1999" text, "2000" text, "2001" text, "2002" text, "2003" text, "2004" text, "2005" text, "2006" text )
During the Hamburg Masters Tournament, during which Ji Nov k was absent(A) in 1998, how did he do in 1997?
SELECT "1997" FROM table_7416 WHERE "1998" = 'a' AND "Tournament" = 'hamburg masters'
CREATE TABLE table_204_731 ( id number, "rank" number, "athlete" text, "shooting\nscore (pts)" text, "fencing\nvictories (pts)" text, "swimming\ntime (pts)" text, "riding\npenalties (pts)" text, "running\ntime (pts)" text, "total" number )
which athlete scored the most points ?
SELECT "athlete" FROM table_204_731 ORDER BY "total" DESC LIMIT 1
CREATE TABLE Movie ( title VARCHAR, mID VARCHAR ) CREATE TABLE Rating ( mID VARCHAR )
What is the name of the movie that is rated by most of times?
SELECT T2.title, T1.mID FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T1.mID ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_name_91 ( score VARCHAR, outcome VARCHAR, tournament VARCHAR )
What was the score of the marco island tournament match when Kathleen Horvath won runner-up?
SELECT score FROM table_name_91 WHERE outcome = "runner-up" AND tournament = "marco island"
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 vitalperiodic ( vitalperiod...
what number of patients received a stress ulcer prophylaxis - pantoprazole procedure in the same month after receiving a cultures procedure last year?
SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'cultures' AND DATETIME(treatment.treatmenttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year',...
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemicsysto...
what medical procedure did patient 021-80293 first receive during the current hospital visit?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-80293' AND patient.hospitaldischargetime IS NULL)) ORDER BY t...
CREATE TABLE table_17594659_1 ( competition VARCHAR, opposition VARCHAR )
Name the competition of panathinaikos
SELECT competition FROM table_17594659_1 WHERE opposition = "Panathinaikos"
CREATE TABLE table_1341843_44 ( candidates VARCHAR, incumbent VARCHAR )
Who was the candidate when the incumbent was Richard C. White?
SELECT candidates FROM table_1341843_44 WHERE incumbent = "Richard C. White"
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, ...
just count how many patients have been prescribed amiodarone 900 mg in 500 ml d5w in 2105.
SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'amiodarone 900 mg in 500 ml d5w' AND STRFTIME('%y', medication.drugstarttime) = '2105')
CREATE TABLE table_17340355_6 ( game VARCHAR, team VARCHAR )
Which game was played by team milwaukee
SELECT game FROM table_17340355_6 WHERE team = "Milwaukee"
CREATE TABLE table_40906 ( "Block" text, "Launched" real, "Operational" real, "Not usable" real, "Retired" real, "Launch Failures" real )
What is the highest number of not usable satellites when there are more than 0 launch failures, less than 30 retired, and the block is I?
SELECT MAX("Not usable") FROM table_40906 WHERE "Launch Failures" > '0' AND "Retired" < '30' AND "Block" = 'block i'
CREATE TABLE classroom ( building text, room_number text, capacity number ) CREATE TABLE student ( id text, name text, dept_name text, tot_cred number ) CREATE TABLE takes ( id text, course_id text, sec_id text, semester text, year number, grade text ) CREATE TABLE...
Find the building, room number, semester and year of all courses offered by Psychology department sorted by course titles.
SELECT T2.building, T2.room_number, T2.semester, T2.year FROM course AS T1 JOIN section AS T2 ON T1.course_id = T2.course_id WHERE T1.dept_name = 'Psychology' ORDER BY T1.title
CREATE TABLE table_name_38 ( shots INTEGER, points INTEGER )
What is the lowest Shots with a Point that is larger than 32?
SELECT MIN(shots) FROM table_name_38 WHERE points > 32
CREATE TABLE table_name_96 ( place VARCHAR, score VARCHAR )
What is the place of the person with a score of 67-70=137?
SELECT place FROM table_name_96 WHERE score = 67 - 70 = 137
CREATE TABLE program ( program_id int, name varchar, college varchar, introduction 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...
Which classes in the upper-level are 10 credits ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 10 AND program_course.category LIKE 'ULCS'
CREATE TABLE table_4636 ( "Date" text, "Pages" text, "Hero" text, "Story" text, "Story code" text )
What is the story code of the story published on 2002-12?
SELECT "Story code" FROM table_4636 WHERE "Date" = '2002-12'
CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId number, CloseAsOffTopicReasonTypeId number, DuplicateOfQuestionId number, BelongsOnBaseHostAddress text ) CREATE TABLE PostsWithDeleted ( Id number, PostTypeId number, ...
Percentage of users with 10,000 and 20,000 reputation or more.
SELECT (((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation > 10000) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Users)) * 100) AS PercentageOver10k, (((SELECT CAST(COUNT(*) AS FLOAT) FROM Users WHERE Reputation > 30000) / (SELECT CAST(COUNT(*) AS FLOAT) FROM Users)) * 100) AS PercentageOver20k
CREATE TABLE table_45836 ( "Club" text, "City" text, "Stadium" text, "Capacity" real, "2007\u201308 season" text )
What 2007-08 season has marcianise as the city?
SELECT "2007\u201308 season" FROM table_45836 WHERE "City" = 'marcianise'
CREATE TABLE table_7405 ( "Position" text, "Name" text, "Birthdate" text, "Birthplace" text, "Team" text )
What is the Birthdate of raymond bonney?
SELECT "Birthdate" FROM table_7405 WHERE "Name" = 'raymond bonney'
CREATE TABLE table_22034853_1 ( language_s_ VARCHAR, film_title_used_in_nomination VARCHAR )
What was the language for the movie 'Late Bloomers'?
SELECT language_s_ FROM table_22034853_1 WHERE film_title_used_in_nomination = "Late Bloomers"
CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE field ( fieldid int ) CREATE TABLE paperkeyphrase ( paperid int, keyphraseid int ) CREATE TABLE dataset ( datasetid int, datasetname varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE ...
how many papers are based on ImageNet
SELECT DISTINCT COUNT(DISTINCT paper.paperid) FROM dataset, paper, paperdataset WHERE dataset.datasetname LIKE 'ImageNet' AND paperdataset.datasetid = dataset.datasetid AND paper.paperid = paperdataset.paperid
CREATE TABLE table_name_46 ( notes VARCHAR, format VARCHAR )
What is the Notes of the Frequency with a Format of soft adult contemporary?
SELECT notes FROM table_name_46 WHERE format = "soft adult contemporary"
CREATE TABLE Residents_Services ( resident_id INTEGER, service_id INTEGER, date_moved_in DATETIME, property_id INTEGER, date_requested DATETIME, date_provided DATETIME, other_details VARCHAR(255) ) CREATE TABLE Residents ( resident_id INTEGER, property_id INTEGER, date_moved_in ...
Bar chart x axis date moved in y axis how many date moved in
SELECT date_moved_in, COUNT(date_moved_in) FROM Customer_Events
CREATE TABLE table_28052 ( "Episode no." real, "Airdate" text, "Dave Viewers" real, "Dave Rank" real, "Rank (cable)" real, "Dave ja vu Viewers" real, "Total viewers" real )
What is the lowest cable rank of an episode with 1464000 viewers?
SELECT MIN("Rank (cable)") FROM table_28052 WHERE "Total viewers" = '1464000'
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, ...
has patient 021-124150 had an allergy since 1 year ago?
SELECT COUNT(*) > 0 FROM allergy WHERE allergy.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-124150')) AND DATETIME(allergy.allergytime) >= DATETIME(CURRENT_TIME(), '-1 ...
CREATE TABLE table_11318462_5 ( open_2nd_viii VARCHAR, u15_3rd_iv VARCHAR )
how many open 2nd viii had u15 3rd iv being gt
SELECT COUNT(open_2nd_viii) FROM table_11318462_5 WHERE u15_3rd_iv = "GT"
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...
count the number of patients whose year of birth is less than 2060 and procedure long title is other closed [endoscopic] biopsy of biliary duct or sphincter of oddi?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dob_year < "2060" AND procedures.long_title = "Other closed [endoscopic] biopsy of biliary duct or sphincter of Oddi"
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...
Find the number of patients who were diagnosed with st elevated myocardial infarction/cardiac cath and the lab test fluid ascites.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "ST ELEVATED MYOCARDIAL INFARCTION\CARDIAC CATH" AND lab.fluid = "Ascites"
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 living patients who had a hematocrit other fluid lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.expire_flag = "0" AND lab.label = "Hematocrit, Other Fluid"
CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE demographic (...
let me know both the short title and long tilte of diagnoses for patient with patient id 23733.
SELECT diagnoses.short_title, diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "23733"
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, show me about the distribution of name and code , and group by attribute founder in a bar chart, and display X-axis in ascending order please.
SELECT T1.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder, T1.Name ORDER BY T1.Name
CREATE TABLE table_2679 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
What's the score of the game with 31-29 record?
SELECT "Score" FROM table_2679 WHERE "Record" = '31-29'
CREATE TABLE table_27720737_1 ( original_air_date VARCHAR, us_viewers__million_ VARCHAR )
What is the original air date when the u.s. viewers in millions was 5.39?
SELECT original_air_date FROM table_27720737_1 WHERE us_viewers__million_ = "5.39"
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) 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 ) ...
what is the maximum monthly number of patients who have had orthostatic hypotension since 6 years ago?
SELECT MAX(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 = 'orthostatic hypotension') AND DATETIME(diagnoses_icd.charttime) >= DATETIME(CURRENT_TIME(), '-6 year')...
CREATE TABLE table_name_64 ( played INTEGER, points VARCHAR, position VARCHAR, goals_for VARCHAR, draws VARCHAR )
What are the average number of played with goals of less than 43, more than 9 draws, a higher position than 17 and 30-8 points?
SELECT AVG(played) FROM table_name_64 WHERE goals_for < 43 AND draws > 9 AND position > 17 AND points = "30-8"
CREATE TABLE table_name_43 ( record VARCHAR, attendance INTEGER )
Which record has an attendance larger than 28,459?
SELECT record FROM table_name_43 WHERE attendance > 28 OFFSET 459
CREATE TABLE table_4463 ( "Round" real, "Track" text, "Date" text, "Pole Position" text, "Fastest Lap" text, "Winner" text, "Team" text )
On which track did Takashi Kogure hold pole position?
SELECT "Track" FROM table_4463 WHERE "Pole Position" = 'takashi kogure'
CREATE TABLE table_204_360 ( id number, "year" number, "host" text, "gold" text, "silver" text, "bronze" text )
in what year did the fiba south america under-17 championship for women first begin ?
SELECT MIN("year") FROM table_204_360
CREATE TABLE table_71859 ( "Player" text, "Country" text, "Year(s) won" text, "Total" real, "To par" real )
What was the score to par for 156 strokes?
SELECT COUNT("To par") FROM table_71859 WHERE "Total" > '156'
CREATE TABLE table_name_13 ( week INTEGER, attendance VARCHAR )
In what Week was the Attendance 43,430?
SELECT MAX(week) FROM table_name_13 WHERE attendance = 43 OFFSET 430
CREATE TABLE table_name_23 ( name VARCHAR, location VARCHAR )
What is Name, when Location is 'DZ'?
SELECT name FROM table_name_23 WHERE location = "dz"
CREATE TABLE food_service ( meal_code text, meal_number int, compartment text, meal_description varchar ) CREATE TABLE airport ( airport_code varchar, airport_name text, airport_location text, state_code varchar, country_name varchar, time_zone_code varchar, minimum_connect_...
MIAMI to CLEVELAND sunday afternoon
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 = 27 AND DATE_DAYalias0.month_number = 8 AND DATE_DAYalias0.year = 1991)) AND to...
CREATE TABLE table_60814 ( "Name" text, "Dates active" text, "Windspeeds" text, "Pressure" text, "Deaths" text )
What pressure is Ken?
SELECT "Pressure" FROM table_60814 WHERE "Name" = 'ken'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
count the number of times patient 030-42006 on the current hospital visit had received a exploratory laparoscopy procedure.
SELECT COUNT(*) FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-42006' AND patient.hospitaldischargetime IS NULL)) AND treatment.treatmentna...
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, ...
give me the number of patients whose primary disease is gastrointestinal bleed and procedure short title is gastroenterostomy nec?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "GASTROINTESTINAL BLEED" AND procedures.short_title = "Gastroenterostomy NEC"
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 admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time,...
since 89 months ago, what was the daily average value of the potassium of patient 81223?
SELECT AVG(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 81223) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'potassium') AND DATETIME(labevents.charttime) >= DATETIME(CURRENT_TIME(), '...
CREATE TABLE table_9239 ( "Player" text, "No.(s)" text, "Height in Ft." text, "Position" text, "Years with Spurs" text, "School/Previous Club Team/Country" text )
What is Position, when School/Previous Club Team/Country is Kentucky?
SELECT "Position" FROM table_9239 WHERE "School/Previous Club Team/Country" = 'kentucky'
CREATE TABLE table_22182 ( "Season" real, "Average Attendance Home" text, "Highest Attendance Home" text, "Average Attendance Away" text, "Highest Attendance Away" text, "Division / Section" text, "Level" text, "Average Attendance League" text )
Which division has an average home attendance of 2.459?
SELECT "Division / Section" FROM table_22182 WHERE "Average Attendance Home" = '2.459'
CREATE TABLE table_49800 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What is Tournament, when Result is 18th?
SELECT "Tournament" FROM table_49800 WHERE "Result" = '18th'
CREATE TABLE table_name_7 ( college_junior_club_team VARCHAR, pick VARCHAR, round VARCHAR )
Which College/Junior/Club Team has a Pick larger than 70, and a Round smaller than 7?
SELECT college_junior_club_team FROM table_name_7 WHERE pick > 70 AND round < 7
CREATE TABLE Dorm_amenity ( amenid INTEGER, amenity_name VARCHAR(25) ) CREATE TABLE Has_amenity ( dormid INTEGER, amenid INTEGER ) CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number INTEGER ) CREATE TABLE Dorm ( dormid INTEGER, dorm_name VARCHAR(20), student_ca...
Find the number of male students (with sex M) from each city in a bar chart, rank Y in asc order.
SELECT city_code, COUNT(*) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY COUNT(*)
CREATE TABLE table_35865 ( "Gauge" text, "Railway" text, "Works no." text, "Year" text, "Builder" text )
What is the Gauge of Builder Beyer, Peacock?
SELECT "Gauge" FROM table_35865 WHERE "Builder" = 'beyer, peacock'
CREATE TABLE table_name_79 ( latitude VARCHAR, year_named VARCHAR, name VARCHAR )
Which Latitude has a Year named smaller than 1997, and a Name of aino planitia?
SELECT latitude FROM table_name_79 WHERE year_named < 1997 AND name = "aino planitia"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
find the number of patients admitted in emergency whose drug code is glyc 1r.
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.icd9_code = "80624" AND prescriptions.route = "INHALATION"
CREATE TABLE table_name_8 ( loss VARCHAR, record VARCHAR )
Which team has the record of 11-6?
SELECT loss FROM table_name_8 WHERE record = "11-6"
CREATE TABLE table_25213146_2 ( circuit VARCHAR, winning_driver VARCHAR )
In what circuit was Bruno Spengler the winning driver?
SELECT circuit FROM table_25213146_2 WHERE winning_driver = "Bruno Spengler"
CREATE TABLE table_name_50 ( year INTEGER, genre VARCHAR )
What is total number of years that has genre of first-person shooter?
SELECT SUM(year) FROM table_name_50 WHERE genre = "first-person shooter"
CREATE TABLE table_name_3 ( away_team VARCHAR, home_team VARCHAR )
What is the away side's score when richmond is at home?
SELECT away_team AS score FROM table_name_3 WHERE home_team = "richmond"
CREATE TABLE table_76260 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" text )
What is the highest week that was played against the Minnesota Vikings?
SELECT MAX("Week") FROM table_76260 WHERE "Opponent" = 'minnesota vikings'
CREATE TABLE table_name_25 ( constructor VARCHAR, driver VARCHAR, rounds VARCHAR )
Who was the constructor of the car that Jan Lammers made 7-14 rounds in?
SELECT constructor FROM table_name_25 WHERE driver = "jan lammers" AND rounds = "7-14"
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subje...
what is the last time that patient 51177 received a microbiology test?
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 51177) ORDER BY microbiologyevents.charttime DESC LIMIT 1