table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_name_28 ( place VARCHAR, player VARCHAR )
What is the place of Mark O'Meara?
SELECT place FROM table_name_28 WHERE player = "mark o'meara"
CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER ) CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL )
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name by a bar chart, I want to show by the X-axis in descending.
SELECT T2.Name, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC
CREATE TABLE table_204_3 ( id number, "rank" number, "name" text, "nationality" text, "time" number )
who ranked number 8 after jose meolans finished in 7th ?
SELECT "name" FROM table_204_3 WHERE "rank" = 8
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 text, name text, marital_status text, age text, dob text, gender text, language text, religion text, ...
How many patients with morbid obesity/sda primary disease had a csf lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "MORBID OBESITY/SDA" AND lab.fluid = "Cerebrospinal Fluid (CSF)"
CREATE TABLE table_203_561 ( id number, "pos" number, "team" text, "total" number, "high" number, "low" number, "average" number, "change" text )
name the only team whose percentage change was positive .
SELECT "team" FROM table_203_561 WHERE "change" > 0
CREATE TABLE table_name_94 ( total INTEGER, bronze VARCHAR, silver VARCHAR )
What is the average total medals of the nation with 4 bronze and more than 1 silver medals?
SELECT AVG(total) FROM table_name_94 WHERE bronze = 4 AND silver > 1
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugst...
what was the name of drug that was prescribed first to patient 021-111547 in 12/this year?
SELECT medication.drugname FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '021-111547')) AND DATETIME(medication.drugstarttime, 'start of year...
CREATE TABLE buildings ( id number, name text, city text, height number, stories number, status text ) CREATE TABLE office_locations ( building_id number, company_id number, move_in_year number ) CREATE TABLE companies ( id number, name text, headquarters text, indu...
List the names of buildings in descending order of building height.
SELECT name FROM buildings ORDER BY height DESC
CREATE TABLE table_67680 ( "Year" real, "Tournament" text, "Venue" text, "Result" text, "Extra" text )
What year was the race in Vienna, Austria?
SELECT MIN("Year") FROM table_67680 WHERE "Venue" = 'vienna, austria'
CREATE TABLE table_24144 ( "Season" text, "1st Place" text, "2nd Place" text, "3rd Place" text, "4th Place" text )
Name the 1st place for limoges csp
SELECT "1st Place" FROM table_24144 WHERE "3rd Place" = 'Limoges CSP'
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
What is average age for different job title Visualize by bar chart, I want to display by the job from high to low.
SELECT job, AVG(age) FROM Person GROUP BY job ORDER BY job DESC
CREATE TABLE Customers ( customer_status_code VARCHAR )
Which customer status code has least number of customers?
SELECT customer_status_code FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) LIMIT 1
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_Per...
Give me a pie chart to reflect the proportion of All_Home and the sum of School_ID.
SELECT All_Home, SUM(School_ID) FROM basketball_match GROUP BY All_Home
CREATE TABLE table_name_35 ( grid VARCHAR, laps VARCHAR )
What is the grid total associated with 18 laps?
SELECT COUNT(grid) FROM table_name_35 WHERE laps = 18
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number,...
what was the monthly maximum amount of urine catheter given to patient 009-12985 until 62 months ago?
SELECT MAX(intakeoutput.cellvaluenumeric) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-12985')) AND intakeoutput.celllabel = 'urine...
CREATE TABLE table_62274 ( "Draw" real, "Language" text, "Artist" text, "Song" text, "English translation" text, "National final" text, "Place" real, "Points" real )
what is the language when the english translation is come to me?
SELECT "Language" FROM table_62274 WHERE "English translation" = 'come to me'
CREATE TABLE table_71360 ( "Year" text, "Division" text, "League" text, "Regular Season" text, "Playoffs" text )
What years did the Nashville Metros have Usisl Indoor League?
SELECT "Year" FROM table_71360 WHERE "League" = 'usisl indoor'
CREATE TABLE table_name_24 ( laps INTEGER, time_retired VARCHAR, driver VARCHAR )
Tell me the highest laps for time/retired of +2 laps and driver of felice bonetto
SELECT MAX(laps) FROM table_name_24 WHERE time_retired = "+2 laps" AND driver = "felice bonetto"
CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, CreationDate time, UserDisplayName text, UserId number, ContentLicense text ) CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time...
Amount of unique users for a tag (or tags).
SELECT Id FROM Tags WHERE TagName IN ('office-js')
CREATE TABLE table_60992 ( "Season" text, "LKF Cup" text, "Regional Competitions" text, "Europe" text, "Head Coach" text )
WHAT SEASON HAD COACH JONAS KAZLAUSKAS AT champions cup group stage?
SELECT "Season" FROM table_60992 WHERE "Head Coach" = 'jonas kazlauskas' AND "Europe" = 'champions cup group stage'
CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, ...
what's last arterial bp [diastolic] value of patient 4368 on 05/28/2105?
SELECT chartevents.valuenum FROM chartevents WHERE chartevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 4368)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial b...
CREATE TABLE table_34691 ( "Date" real, "Name" text, "Developer" text, "Clock" text, "Process" text, "Cores per die / Dies per module" text )
What is the latest date with Cores per die / Dies per module of 2 / 1, and a Clock of 1.4-1.6ghz?
SELECT MAX("Date") FROM table_34691 WHERE "Cores per die / Dies per module" = '2 / 1' AND "Clock" = '1.4-1.6ghz'
CREATE TABLE table_name_49 ( competition VARCHAR, goal VARCHAR )
What competition has a goal number of 13?
SELECT competition FROM table_name_49 WHERE goal = 13
CREATE TABLE table_name_73 ( date VARCHAR, attendance VARCHAR )
Which date had 67,472 in attendance?
SELECT date FROM table_name_73 WHERE attendance = "67,472"
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetake...
how much is the change of respiration of patient 006-36108 last measured on the first icu visit compared to the value first measured on the first icu visit?
SELECT (SELECT vitalperiodic.respiration FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-36108') AND NOT patient.unitdischargetime I...
CREATE TABLE table_name_72 ( date VARCHAR, crowd INTEGER )
Which Date has a Crowd smaller than 4,485?
SELECT date FROM table_name_72 WHERE crowd < 4 OFFSET 485
CREATE TABLE regions ( REGION_ID decimal(5,0), REGION_NAME varchar(25) ) CREATE TABLE jobs ( JOB_ID varchar(10), JOB_TITLE varchar(35), MIN_SALARY decimal(6,0), MAX_SALARY decimal(6,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,...
For those employees who did not have any job in the past, give me the trend about department_id over hire_date , display in ascending by the HIRE_DATE.
SELECT HIRE_DATE, DEPARTMENT_ID FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY HIRE_DATE
CREATE TABLE table_name_29 ( score VARCHAR, opponent_in_the_final VARCHAR )
What was the final score of the game against Lenka Novotn ?
SELECT score FROM table_name_29 WHERE opponent_in_the_final = "lenka novotná"
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE admissions ( row_id numbe...
first time patient 2514 got a procedure since 2103?
SELECT procedures_icd.charttime FROM procedures_icd WHERE procedures_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 2514) AND STRFTIME('%y', procedures_icd.charttime) >= '2103' ORDER BY procedures_icd.charttime LIMIT 1
CREATE TABLE table_name_97 ( opponent VARCHAR, attendance VARCHAR )
What is the Opponent at the game with Attendance of 68,436?
SELECT opponent FROM table_name_97 WHERE attendance = "68,436"
CREATE TABLE table_11621915_1 ( date VARCHAR, tournament VARCHAR )
what's the date with tournament value of ford senior players championship
SELECT date FROM table_11621915_1 WHERE tournament = "Ford Senior Players Championship"
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE d_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_procedures ( row_id number, icd9_c...
what are the four drugs most frequently prescribed during the same hospital visit to the patients aged 60 or above after being diagnosed with neutropenia nos in 2100?
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 table_62186 ( "Name" text, "Championship" real, "League Cup" real, "FA Cup" real, "Total" real )
What is the highest league up with less than 3 championships, a total less than 2, and a FA cup larger than 0?
SELECT MAX("League Cup") FROM table_62186 WHERE "Championship" < '3' AND "Total" < '2' AND "FA Cup" > '0'
CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org_name text ) CREATE TABLE chartevents ( row_id number, subject_id number, hadm_id number, icustay_id number, itemid number, charttime time, val...
how many procedures of ex cereb meningeal les have been performed in the previous year?
SELECT COUNT(*) FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'ex cereb meningeal les') AND DATETIME(procedures_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year')
CREATE TABLE table_5050 ( "Game" text, "Date" text, "Home Team" text, "Result" text, "Road Team" text )
On what date was the result 106-105?
SELECT "Date" FROM table_5050 WHERE "Result" = '106-105'
CREATE TABLE departments ( department_id number, dept_store_id number, department_name text ) CREATE TABLE customers ( customer_id number, payment_method_code text, customer_code text, customer_name text, customer_address text, customer_phone text, customer_email text ) CREATE ...
What are the ids and names of customers with addressed that contain WY and who do not use a credit card for payment?
SELECT customer_id, customer_name FROM customers WHERE customer_address LIKE "%WY%" AND payment_method_code <> "Credit Card"
CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, discharge_location text, insurance text, language text, marital_status text, ethnicity text, age number ) CREATE ...
how much does it cost for patient 27591's hospital stay until 2102.
SELECT SUM(cost.cost) FROM cost WHERE cost.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27591) AND STRFTIME('%y', cost.chargetime) <= '2102'
CREATE TABLE table_52806 ( "Year" text, "2010" real, "2009" real, "2008" real, "2005" real, "2000" real, "1995" real, "1990" real, "1985" real )
What is the largest 2000 GDP when the 2008 GDP is smaller than 3,632, 2010 GDP is 2,558 and 2009 GDP is larger than 2,239?
SELECT MAX("2000") FROM table_52806 WHERE "2008" < '3,632' AND "2010" = '2,558' AND "2009" > '2,239'
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...
what is a procedure patient 006-181433 received for the first time on 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 = '006-181433' AND patient.hospitaldischargetime IS NULL)) ORDER BY ...
CREATE TABLE table_14757 ( "Series" text, "Name" text, "Hometown" text, "Occupation" text, "Status" text )
What is Hasan Shah's hometown?
SELECT "Hometown" FROM table_14757 WHERE "Name" = 'hasan shah'
CREATE TABLE table_204_418 ( id number, "date" text, "opponent" text, "score" text, "overall record" text, "scba record" text )
on how many dates was the sum of the scores at most 10 ?
SELECT COUNT("date") FROM table_204_418 WHERE "score" + "score" <= 10
CREATE TABLE table_75602 ( "Call sign" text, "Frequency MHz" real, "City of license" text, "ERP W" real, "Class" text, "FCC info" text )
Frequency MHz smaller than 95.3, and a Call sign of k234ag is what class?
SELECT "Class" FROM table_75602 WHERE "Frequency MHz" < '95.3' AND "Call sign" = 'k234ag'
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,...
what is admission type and admission location of subject name jerry deberry?
SELECT demographic.admission_type, demographic.admission_location FROM demographic WHERE demographic.name = "Jerry Deberry"
CREATE TABLE table_26847237_1 ( win_loss VARCHAR, round__number VARCHAR )
Was it a win or loss for Wanganui in round 3?
SELECT win_loss FROM table_26847237_1 WHERE round__number = "Round 3"
CREATE TABLE table_203_43 ( id number, "polling firm" text, "month" text, "link" text, "favor" number, "oppose" number )
how many zogby international polls took place in the month of august ?
SELECT COUNT("polling firm") FROM table_203_43 WHERE "polling firm" = 'zogby international' AND "month" = 8
CREATE TABLE table_33414 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
Who was the home team when the away team scored 5.9 (39)?
SELECT "Home team score" FROM table_33414 WHERE "Away team score" = '5.9 (39)'
CREATE TABLE table_62689 ( "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
Who was the Partner in the Algiers 2, Algeria Tournament?
SELECT "Partner" FROM table_62689 WHERE "Tournament" = 'algiers 2, algeria'
CREATE TABLE table_49747 ( "Date" text, "Ship" text, "Nationality" text, "Tonnage" real, "Fate" text )
What is the Nationality of the Aracataca Ship?
SELECT "Nationality" FROM table_49747 WHERE "Ship" = 'aracataca'
CREATE TABLE table_80454 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" real, "Record" text )
Which opponent has an attendance greater than 29,904 and 11-8 as the record?
SELECT "Opponent" FROM table_80454 WHERE "Attendance" > '29,904' AND "Record" = '11-8'
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm...
how many days have elapsed since the first time patient 10855 had an intake of .9% normal saline on the current icu visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) 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 = 10855) AND icustays.outtime IS NULL) ...
CREATE TABLE table_203_295 ( id number, "position" number, "driver / passenger" text, "equipment" text, "points" number, "wins" number, "second" number, "third" number )
the number of points daniel willemsen scored with his passenger
SELECT "points" FROM table_203_295 WHERE "driver / passenger" = 'daniel willemsen'
CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int ) CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text )
Plot the total number by grouped by country as a bar graph, and order by the y axis from low to high please.
SELECT Country, COUNT(*) FROM member GROUP BY Country ORDER BY COUNT(*)
CREATE TABLE table_10694 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
I want the lowest Laps for time/retired of engine and driver of charles de tornaco
SELECT MIN("Laps") FROM table_10694 WHERE "Time/Retired" = 'engine' AND "Driver" = 'charles de tornaco'
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...
how many patients of black/cape verdean ethnicity are born before 2184?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND demographic.dob_year < "2184"
CREATE TABLE table_32732 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the score for Hawthorn as an away team?
SELECT "Away team score" FROM table_32732 WHERE "Away team" = 'hawthorn'
CREATE TABLE table_21025437_5 ( viewers__millions_ VARCHAR, episode_no VARCHAR )
How many million viewers watched episode number 20?
SELECT viewers__millions_ FROM table_21025437_5 WHERE episode_no = 20
CREATE TABLE table_73337 ( "Chapter" text, "Installation Date" text, "Institution" text, "Location" text, "Inactive" text )
What was the installation date in El Paso, Texas?
SELECT "Installation Date" FROM table_73337 WHERE "Location" = 'El Paso, Texas'
CREATE TABLE table_29747178_2 ( title VARCHAR, series__number VARCHAR )
What is the title when the series # is 7?
SELECT title FROM table_29747178_2 WHERE series__number = 7
CREATE TABLE table_10935205_1 ( canadian_airdate VARCHAR, us_airdate VARCHAR )
The U.S. airdate of 8 august 2008 also had canadian airdates of what?
SELECT canadian_airdate FROM table_10935205_1 WHERE us_airdate = "8 August 2008"
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number...
in 2103, what were the five most frequent medications prescribed to patients in the same hospital encounter after the diagnosis of pain?
SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pain' AND STRFT...
CREATE TABLE table_40074 ( "Ring name" text, "Current rank" text, "Debut" text, "Stable" text, "Birthplace" text )
What is Current Rank, when Ring Name is Tamaasuka Daisuke?
SELECT "Current rank" FROM table_40074 WHERE "Ring name" = 'tamaasuka daisuke'
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_status text, age text, dob te...
give me the number of patients with procedure icd9 code 966 who were admitted in hospital before 2138.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2138" AND procedures.icd9_code = "966"
CREATE TABLE table_67806 ( "Date" text, "Opponent" text, "Score" text, "Loss" text, "Attendance" text, "Record" text )
Can you tell me the Attendance that has the Date of april 12?
SELECT "Attendance" FROM table_67806 WHERE "Date" = 'april 12'
CREATE TABLE table_30482 ( "Parent unit" text, "Geschwader Base" text, "Unit (Gruppe/Staffel)" text, "Aircraft Type" text, "Commanding Officer" text )
Name the aircraft type for jagdgeschwader 6
SELECT "Aircraft Type" FROM table_30482 WHERE "Parent unit" = 'Jagdgeschwader 6'
CREATE TABLE table_name_16 ( inclination VARCHAR, semimajor_axis___au__ VARCHAR )
What inclination has a semimajor axis of 20 au?
SELECT inclination FROM table_name_16 WHERE semimajor_axis___au__ = "20 au"
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 o...
since 5 years ago patient 16571 was diagnosed with a special symptom nec/nos?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'special symptom nec/nos') AND diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 16571) AND DATETIME(diagnoses...
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 prescriptions ( subject_id text, hadm_id...
look for the route of drug administration and primary disease of patient marilyn norvell.
SELECT demographic.diagnosis, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Marilyn Norvell"
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...
provide the number of patients whose diagnoses is crn ath atlg vn bps grft and lab test category is hematology.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Crn ath atlg vn bps grft" AND lab."CATEGORY" = "Hematology"
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE vitalperiodic ( ...
how much does the heartrate change of patient 031-19622 last measured on the last icu visit compared to the second to last value measured on the last icu visit?
SELECT (SELECT vitalperiodic.heartrate FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-19622') AND NOT patient.unitdischargetime IS ...
CREATE TABLE table_51665 ( "Driver" text, "Constructor" text, "Laps" real, "Time/Retired" text, "Grid" real )
What is the number of laps for Grid 14?
SELECT COUNT("Laps") FROM table_51665 WHERE "Grid" = '14'
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...
what is the number of male patients who have ng route of drug administration?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.gender = "M" AND prescriptions.route = "NG"
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_Per...
Stacked bar chart of school_id for with each ACC_Home in each acc road, rank by the Y-axis in asc.
SELECT ACC_Road, School_ID FROM basketball_match GROUP BY ACC_Home, ACC_Road ORDER BY School_ID
CREATE TABLE table_name_44 ( split_off___continuation_of VARCHAR, church_name VARCHAR )
What was the Independent Church's Split off/ Continuation?
SELECT split_off___continuation_of FROM table_name_44 WHERE church_name = "independent church"
CREATE TABLE table_56976 ( "Rank" real, "Name" text, "Nation" text, "SP+FS" real, "Points" real, "Placings" real )
What is the average points value for a rank less than 12 for David Santee?
SELECT AVG("Points") FROM table_56976 WHERE "Rank" < '12' AND "Name" = 'david santee'
CREATE TABLE prescriptions ( row_id number, subject_id number, hadm_id number, startdate time, enddate time, drug text, dose_val_rx text, dose_unit_rx text, route text ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, ...
how much is the change in bicarbonate in patient 83182 last measured on the current hospital visit compared to the first value measured on the current hospital visit?
SELECT (SELECT labevents.valuenum FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 83182 AND admissions.dischtime IS NULL) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'bicarbonate') ORDER BY labevents.chartt...
CREATE TABLE table_30969 ( "Episode" real, "Broadcast date" text, "Guest(s)" text, "Singer(s)" text, "Ratings" text )
which episode did sarah millican and grayson perry appear in
SELECT MIN("Episode") FROM table_30969 WHERE "Guest(s)" = 'Sarah Millican and Grayson Perry'
CREATE TABLE table_1712 ( "Episode #" real, "US air date" text, "Rating" text, "Share" text, "Rating/Share (18\u201349)" text, "Viewers (millions)" text )
How many rating/share values does the episode aired on Saturday, May 9, 2009?
SELECT COUNT("Rating/Share (18\u201349)") FROM table_1712 WHERE "US air date" = 'Saturday, May 9, 2009'
CREATE TABLE table_name_58 ( city VARCHAR, state VARCHAR, venue VARCHAR )
Which city in Texas hosts the Frank Erwin center?
SELECT city FROM table_name_58 WHERE state = "texas" AND venue = "frank erwin center"
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, ...
what is age and insurance of subject id 42067?
SELECT demographic.age, demographic.insurance FROM demographic WHERE demographic.subject_id = "42067"
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...
how many office hospital admission patients had open and other sigmoidectomy?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND procedures.short_title = "Open sigmoidectomy NEC"
CREATE TABLE table_57691 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the scoreof the away team Collingwood?
SELECT "Away team score" FROM table_57691 WHERE "Away team" = 'collingwood'
CREATE TABLE table_name_68 ( total VARCHAR, nation VARCHAR, rank VARCHAR, gold VARCHAR, silver VARCHAR )
What is the total number of Total, when Gold is less than 1, when Silver is greater than 0, when Rank is 14, and when Nation is Afghanistan?
SELECT COUNT(total) FROM table_name_68 WHERE gold < 1 AND silver > 0 AND rank = "14" AND nation = "afghanistan"
CREATE TABLE table_name_66 ( events INTEGER, top_10 VARCHAR, cuts_made VARCHAR, top_5 VARCHAR )
How many total events have cuts made over 12, more than 2 top-5s, and more than 11 top-10s?
SELECT SUM(events) FROM table_name_66 WHERE cuts_made > 12 AND top_5 > 2 AND top_10 > 11
CREATE TABLE table_72112 ( "Rd" real, "Name" text, "Pole Position" text, "Fastest Lap" text, "Winning driver" text, "Winning team" text, "Report" text )
What was the fastest lap time in the Escort Radar Warning 200?
SELECT "Fastest Lap" FROM table_72112 WHERE "Name" = 'Escort Radar Warning 200'
CREATE TABLE table_23141 ( "County" text, "Starky #" real, "Starky %" text, "Hancock #" real, "Hancock %" text, "McCain #" real, "McCain %" text, "Total" real )
how many times was hancock % considered when starky % was 20.96%
SELECT COUNT("Hancock %") FROM table_23141 WHERE "Starky %" = '20.96%'
CREATE TABLE table_name_39 ( points VARCHAR, goals_scored INTEGER )
What were the total number of points when the amount of goals scored was less than 20?
SELECT COUNT(points) FROM table_name_39 WHERE goals_scored < 20
CREATE TABLE table_15829930_5 ( wins INTEGER, success_rate VARCHAR )
Name the least wins of 56.25%
SELECT MIN(wins) FROM table_15829930_5 WHERE success_rate = "56.25%"
CREATE TABLE table_15187735_3 ( segment_c VARCHAR, segment_b VARCHAR )
Name the segment c for pottery
SELECT segment_c FROM table_15187735_3 WHERE segment_b = "Pottery"
CREATE TABLE table_59594 ( "Rank" text, "County" text, "State" text, "Land area (km\u00b2)" text, "Land area (mi\u00b2)" text, "April 1, 2010 census" text, "April 1, 2010 density (/km\u00b2)" text, "April 1, 2010 density (/mi\u00b2)" text, "July 1, 2010 official estimate" text, "...
What is the rank where the July 1, 2010 density equals 437?
SELECT "Rank" FROM table_59594 WHERE "July 1, 2010 density (/km\u00b2)" = '437'
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE cost ( costid number, ...
when did patient 029-27704 receive the last procedure during the first hospital visit?
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 = '029-27704' AND NOT patient.hospitaldischargetime IS NULL ORDER BY...
CREATE TABLE medicine_enzyme_interaction ( enzyme_id number, medicine_id number, interaction_type text ) CREATE TABLE enzyme ( id number, name text, location text, product text, chromosome text, omim number, porphyria text ) CREATE TABLE medicine ( id number, name text,...
How many distinct FDA approval statuses are there for the medicines?
SELECT COUNT(DISTINCT fda_approved) FROM medicine
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE Votes ( Id number, PostId number,...
All posts with a given tag, formatted for copying out post links.
SELECT q.Id AS "Id", 'http://chemistry.stackexchange.com/q/' + CAST(q.Id AS TEXT(15)) AS "Link" FROM Posts AS q WHERE q.PostTypeId = 1 AND q.Tags LIKE '%<' + @Tag + '>%' ORDER BY q.Id
CREATE TABLE PostTags ( PostId number, TagId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, VoteTypeId number, CreationDate time ) CREATE TABLE PostHistory ( Id num...
Number of users which made their last comment in a given month.
WITH last_cte AS (SELECT UserId, MAX(Id) AS MaxId FROM Comments GROUP BY UserId), dates_cte AS (SELECT c.UserId AS odn, c.Id AS cid, c.CreationDate AS CDate FROM Comments AS c INNER JOIN last_cte ON c.Id = maxid) SELECT LAST_DATE_OF_MONTH(CDate), COUNT(odn) FROM dates_cte GROUP BY LAST_DATE_OF_MONTH(CDate) ORDER BY LAS...
CREATE TABLE table_27734577_2 ( team VARCHAR, date VARCHAR )
Which team was the opponent on october 21?
SELECT team FROM table_27734577_2 WHERE date = "October 21"
CREATE TABLE Students ( student_id INTEGER, date_of_registration DATETIME, date_of_latest_logon DATETIME, login_name VARCHAR(40), password VARCHAR(10), personal_name VARCHAR(40), middle_name VARCHAR(40), family_name VARCHAR(40) ) CREATE TABLE Course_Authors_and_Tutors ( author_id IN...
Find password and gender_mf , and visualize them by a bar chart.
SELECT password, gender_mf FROM Course_Authors_and_Tutors ORDER BY personal_name
CREATE TABLE table_name_50 ( sio_2 INTEGER, na_2_o VARCHAR, k_2_o VARCHAR, fe_2_o_3 VARCHAR )
What is the highest SiO 2, when K 2 O is greater than 0.16, when Fe 2 O 3 is greater than 0.16, and when Na 2 O is less than 7.53?
SELECT MAX(sio_2) FROM table_name_50 WHERE k_2_o > 0.16 AND fe_2_o_3 > 0.16 AND na_2_o < 7.53
CREATE TABLE table_73387 ( "Year" real, "Champion" text, "Country" text, "Venue" text, "Location of venue" text, "Winners Score" text, "Winners share ( $ )" real )
Where is the Bellerive Country Club venue located?
SELECT "Location of venue" FROM table_73387 WHERE "Venue" = 'Bellerive Country Club'
CREATE TABLE table_name_96 ( opponent VARCHAR, week VARCHAR )
Who is the opponent for week 5?
SELECT opponent FROM table_name_96 WHERE week = 5
CREATE TABLE table_6902 ( "Year" text, "Playoff round" text, "Venue" text, "Winner" text, "Result" text, "Loser" text )
What is the Loser when the winner was los angeles lakers (10)?
SELECT "Loser" FROM table_6902 WHERE "Winner" = 'los angeles lakers (10)'
CREATE TABLE Roles ( Role_Code CHAR(15), Role_Name VARCHAR(255), Role_Description VARCHAR(255) ) CREATE TABLE Document_Locations ( Document_ID INTEGER, Location_Code CHAR(15), Date_in_Location_From DATETIME, Date_in_Locaton_To DATETIME ) CREATE TABLE Employees ( Employee_ID INTEGER, ...
Show the number of documents in different starting date and bin starting date by year interval with a line chart.
SELECT Date_in_Location_From, COUNT(Date_in_Location_From) FROM Document_Locations