instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Return the address of customer 10. | CREATE TABLE customer_addresses (address_id VARCHAR,customer_id VARCHAR)CREATE TABLE addresses (address_details VARCHAR,address_id VARCHAR) | SELECT T1.address_details FROM addresses AS T1 JOIN customer_addresses AS T2 ON T1.address_id = T2.address_id WHERE T2.customer_id = 10 |
what was the most number of points scored in a game ? | CREATE TABLE table_203_431 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT "score" + "score" FROM table_203_431 ORDER BY ("score" + "score") DESC LIMIT 1 |
Draw a pie chart for how many registed students do each course have? List course name and the number of their registered students? | CREATE TABLE Courses (course_id VARCHAR(100),course_name VARCHAR(120),course_description VARCHAR(255),other_details VARCHAR(255))CREATE TABLE Students (student_id INTEGER,student_details VARCHAR(255))CREATE TABLE Student_Course_Registrations (student_id INTEGER,course_id INTEGER,registration_date DATETIME)CREATE TABLE ... | SELECT course_name, COUNT(*) FROM Students AS T1 JOIN Student_Course_Registrations AS T2 ON T1.student_id = T2.student_id JOIN Courses AS T3 ON T2.course_id = T3.course_id GROUP BY T2.course_id |
What is the spike for the club of d.c. in 2008? | CREATE TABLE table_66432 ("Name" text,"Height" text,"Weight" text,"Spike" text,"2008 club" text) | SELECT "Spike" FROM table_66432 WHERE "2008 club" = 'd.c.' |
Name the surface when the partner is carlos berlocq | CREATE TABLE table_51313 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Partner" text,"Opponents" text,"Score" text) | SELECT "Surface" FROM table_51313 WHERE "Partner" = 'carlos berlocq' |
What is High Rebounds, when High Assists is 'Jason Kidd (13)'? | CREATE TABLE table_77159 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High rebounds" FROM table_77159 WHERE "High assists" = 'jason kidd (13)' |
What date did the player from Santo Andr debut? | CREATE TABLE table_53556 ("Name" text,"Position" text,"From (Club)" text,"Date Joined" text,"Debut" text) | SELECT "Date Joined" FROM table_53556 WHERE "From (Club)" = 'santo andré' |
Which School/Club Team has a Player of michael bradley? | CREATE TABLE table_name_36 (school_club_team VARCHAR,player VARCHAR) | SELECT school_club_team FROM table_name_36 WHERE player = "michael bradley" |
What are the IHSAA classes of the Indianapolis schools? | CREATE TABLE table_66273 ("School" text,"Mascot" text,"Location" text,"Enrollment" real,"IHSAA Class" text,"IHSAA Football Class" text,"County" text) | SELECT "IHSAA Class" FROM table_66273 WHERE "Location" = 'indianapolis' |
how many patients are primarily diagnosed for rash under 43 years of age? | 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 text,gender text,language text,religion text,admission_type text,days_stay ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "RASH" AND demographic.age < "43" |
Which race Leader has a Stage of 7? | CREATE TABLE table_71068 ("Stage" text,"Date" text,"Course" text,"Distance" text,"Winner" text,"Race Leader" text) | SELECT "Race Leader" FROM table_71068 WHERE "Stage" = '7' |
how many top 3 finishes does gordeeva have ? | CREATE TABLE table_204_492 (id number,"year" number,"competition" text,"venue" text,"position" text,"notes" text) | SELECT COUNT(*) FROM table_204_492 WHERE "position" <= 3 |
What id the team with a smaller Time than 18? | CREATE TABLE table_15511 ("Date" text,"Time (CEST)" real,"Team #1" text,"Res." text,"Team #2" text,"Round" text,"Attendance" real) | SELECT "Team #1" FROM table_15511 WHERE "Time ( CEST )" < '18' |
Name the number of year for june 30 | CREATE TABLE table_23015396_1 (year VARCHAR,date VARCHAR) | SELECT COUNT(year) FROM table_23015396_1 WHERE date = "June 30" |
Top 10 names on Stack Overflow beginning by 'Jon'. | 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 Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,Content... | SELECT COUNT(DisplayName), DisplayName FROM Users WHERE UPPER(DisplayName) LIKE 'JON%' GROUP BY DisplayName ORDER BY COUNT(DisplayName) DESC LIMIT 10 |
Who has the Home Score of 52-54? | CREATE TABLE table_name_76 (home VARCHAR,score VARCHAR) | SELECT home FROM table_name_76 WHERE score = "52-54" |
Capacity smaller than 3,292, and a Highest larger than 812, and a Stadium of strathclyde homes stadium has what sum of the average? | CREATE TABLE table_34734 ("Team" text,"Stadium" text,"Capacity" real,"Highest" real,"Lowest" real,"Average" real) | SELECT SUM("Average") FROM table_34734 WHERE "Capacity" < '3,292' AND "Highest" > '812' AND "Stadium" = 'strathclyde homes stadium' |
What was the high assists on April 7? | CREATE TABLE table_21453 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High assists" FROM table_21453 WHERE "Date" = 'April 7' |
For those employees who did not have any job in the past, give me the comparison about the amount of hire_date over the hire_date bin hire_date by weekday, and show Y-axis in desc order. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12),CITY varchar(30),STATE_PROVINCE varchar(25),COUNTRY_ID varchar(2))CREATE TABLE regions (REGION_ID decimal(5,0),REGION_NAME va... | SELECT HIRE_DATE, COUNT(HIRE_DATE) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) ORDER BY COUNT(HIRE_DATE) DESC |
When Kubb is in 9th, who is in 10th? | CREATE TABLE table_17111812_1 (tenth VARCHAR,ninth VARCHAR) | SELECT tenth FROM table_17111812_1 WHERE ninth = "Kubb" |
Can you tell me the Score that has the Opponent of at edmonton oilers? | CREATE TABLE table_47085 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Record" text) | SELECT "Score" FROM table_47085 WHERE "Opponent" = 'at edmonton oilers' |
What is the Long when the ryds is 18? | CREATE TABLE table_name_14 (long VARCHAR,ryds VARCHAR) | SELECT long FROM table_name_14 WHERE ryds = "18" |
What is the total of countys where Obama is popular by 35.44%? | CREATE TABLE table_20688030_1 (county VARCHAR,obama_percentage VARCHAR) | SELECT COUNT(county) FROM table_20688030_1 WHERE obama_percentage = "35.44%" |
Give me a pie chart to show the proportion of event details of events that have more than one participant. | CREATE TABLE Participants_in_Events (Event_ID INTEGER,Participant_ID INTEGER)CREATE TABLE Participants (Participant_ID INTEGER,Participant_Type_Code CHAR(15),Participant_Details VARCHAR(255))CREATE TABLE Events (Event_ID INTEGER,Service_ID INTEGER,Event_Details VARCHAR(255))CREATE TABLE Services (Service_ID INTEGER,Ser... | SELECT Event_Details, COUNT(Event_Details) FROM Events AS T1 JOIN Participants_in_Events AS T2 ON T1.Event_ID = T2.Event_ID GROUP BY Event_Details |
Which Score has High points of douglas (15)? | CREATE TABLE table_name_90 (score VARCHAR,high_points VARCHAR) | SELECT score FROM table_name_90 WHERE high_points = "douglas (15)" |
What is 2011, when 2012 is 'A', and when Tournament is 'French Open'? | CREATE TABLE table_61811 ("Tournament" text,"2009" text,"2010" text,"2011" text,"2012" text) | SELECT "2011" FROM table_61811 WHERE "2012" = 'a' AND "Tournament" = 'french open' |
What is the earliest year in the 125cc class with more than 102 points and a rank of 2nd? | CREATE TABLE table_69839 ("Year" real,"Class" text,"Team" text,"Points" real,"Rank" text,"Wins" real) | SELECT MIN("Year") FROM table_69839 WHERE "Class" = '125cc' AND "Points" > '102' AND "Rank" = '2nd' |
Accept ratio for a site. | CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,RejectionDate time,OwnerUserId number,Comment text,Text text,Title text,Tags text,RevisionGUID other)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE ReviewTaskResults (Id ... | SELECT CAST(COUNT(AcceptedAnswerId) AS FLOAT) / COUNT(*) AS Accept_ratio FROM Posts WHERE PostTypeId = 1 |
What is the number of 2012 passengers in millions that have traveled a distance of 1075km? | CREATE TABLE table_name_56 (distance VARCHAR) | SELECT COUNT(2012 AS _passengers__in_millions_) FROM table_name_56 WHERE distance = "1075km" |
What is the minimum number of f/laps? | CREATE TABLE table_28445 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Poles" real,"F/Laps" real,"Podiums" real,"Points" text,"Position" text) | SELECT MIN("F/Laps") FROM table_28445 |
how many matches were in 2007 ? | CREATE TABLE table_204_854 (id number,"#" number,"wrestlers" text,"reign" number,"date" text,"days\nheld" number,"location" text,"notes" text) | SELECT COUNT(*) FROM table_204_854 WHERE "date" = 2007 |
What country was the golfer with a score of 72-72-72=216 representing? | CREATE TABLE table_name_78 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_78 WHERE score = 72 - 72 - 72 = 216 |
Who ran for office in the Alabama 1 district? | CREATE TABLE table_758 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT "Candidates" FROM table_758 WHERE "District" = 'Alabama 1' |
List all the information about course authors and tutors in alphabetical order of the personal name. | CREATE TABLE subjects (subject_id number,subject_name text)CREATE TABLE course_authors_and_tutors (author_id number,author_tutor_atb text,login_name text,password text,personal_name text,middle_name text,family_name text,gender_mf text,address_line_1 text)CREATE TABLE students (student_id number,date_of_registration ti... | SELECT * FROM course_authors_and_tutors ORDER BY personal_name |
Name the word with pronunciation b of *s ks | CREATE TABLE table_name_55 (word VARCHAR,pronunciation_b VARCHAR) | SELECT word FROM table_name_55 WHERE pronunciation_b = "*sɨks" |
To which political party did the prime minister who served under George V and was born in Manchester belong? | CREATE TABLE table_name_5 (political_party VARCHAR,monarchs_served VARCHAR,birth_place VARCHAR) | SELECT political_party FROM table_name_5 WHERE monarchs_served = "george v" AND birth_place = "manchester" |
Who was born in Porsgrunn? | CREATE TABLE table_name_27 (name VARCHAR,place_of_birth VARCHAR) | SELECT name FROM table_name_27 WHERE place_of_birth = "porsgrunn" |
Return the gender and name of artist who produced the song with the lowest resolution. | CREATE TABLE artist (gender VARCHAR,artist_name VARCHAR)CREATE TABLE song (artist_name VARCHAR,resolution VARCHAR) | SELECT T1.gender, T1.artist_name FROM artist AS T1 JOIN song AS T2 ON T1.artist_name = T2.artist_name ORDER BY T2.resolution LIMIT 1 |
out of total number of patient discharged after long term hospital care, calculate the maximum age of divorcee patients. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho... | SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "DIVORCED" AND demographic.discharge_location = "LONG TERM CARE HOSPITAL" |
How many home games by each year (bin the year attr into weekdays interval)? Give me a line chart, list X-axis from low to high order. | CREATE TABLE postseason (year INTEGER,round TEXT,team_id_winner TEXT,league_id_winner TEXT,team_id_loser TEXT,league_id_loser TEXT,wins INTEGER,losses INTEGER,ties INTEGER)CREATE TABLE fielding (player_id TEXT,year INTEGER,stint INTEGER,team_id TEXT,league_id TEXT,pos TEXT,g INTEGER,gs NUMERIC,inn_outs NUMERIC,po NUMER... | SELECT year, COUNT(year) FROM home_game ORDER BY year |
What is the highest game number where the team was Cleveland? | CREATE TABLE table_22883210_9 (game INTEGER,team VARCHAR) | SELECT MAX(game) FROM table_22883210_9 WHERE team = "Cleveland" |
since 207 days ago, list the daily maximum heartrate of patient 007-15837. | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE microlab (microlabid number,patientunitstayid number... | SELECT MAX(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 = '007-15837')) AND NOT vitalperiodic.heartrate IS NULL... |
how many patient have died after they were diagnosed with cardiac arrest within 2 months? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREA... | SELECT COUNT(DISTINCT t2.subject_id) FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_di... |
For those employees who did not have any job in the past, return a bar chart about the distribution of job_id and the sum of salary , and group by attribute job_id, and could you sort by the Y in ascending please? | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))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 departments (DEPARTMENT_ID decimal(... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(SALARY) |
What position did the 5th place team after 1992 with over 346 laps finish in? | CREATE TABLE table_67857 ("Year" real,"Team" text,"Co-Drivers" text,"Class" text,"Laps" real,"Pos." text,"Class Pos." text) | SELECT "Pos." FROM table_67857 WHERE "Class Pos." = '5th' AND "Year" > '1992' AND "Laps" > '346' |
I want to see 13 -credit Business Forecasting and Equity Valuation courses . | CREATE TABLE course (course_id int,name varchar,department varchar,number varchar,credits varchar,advisory_requirement varchar,enforced_requirement varchar,description varchar,num_semesters int,num_enrolled int,has_discussion varchar,has_lab varchar,has_projects varchar,has_exams varchar,num_reviews int,clarity_score i... | SELECT DISTINCT department, name, number FROM course WHERE (description LIKE '%Business Forecasting and Equity Valuation%' OR name LIKE '%Business Forecasting and Equity Valuation%') AND credits = 13 |
What is the lowest apps for rank 3 and 0% wins? | CREATE TABLE table_64101 ("Rank" real,"Team" text,"Apps" real,"Record" text,"Win %" real) | SELECT MIN("Apps") FROM table_64101 WHERE "Rank" = '3' AND "Win %" < '0' |
Tell me the year built for number built of 10 | CREATE TABLE table_31807 ("Class" text,"Type" text,"No. built (Converted*)" text,"Year built (Converted*)" text,"No. range" text,"Withdrawn" real) | SELECT "Year built (Converted*)" FROM table_31807 WHERE "No. built (Converted*)" = '10' |
give me the number of patients whose insurance is medicare and days of hospital stay is greater than 13? | 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.insurance = "Medicare" AND demographic.days_stay > "13" |
during yesterday, did patient 035-24054 have any output (ml)-nephrostomy left output? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventi... | SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '035-24054')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu... |
What Career has a Super G of 5, and a Combined of 6? | CREATE TABLE table_name_61 (career VARCHAR,super_g VARCHAR,combined VARCHAR) | SELECT career FROM table_name_61 WHERE super_g = "5" AND combined = "6" |
How many votes did Northern Ireland cast if the total was 35? | CREATE TABLE table_10128185_2 (northern_ireland VARCHAR,total VARCHAR) | SELECT northern_ireland FROM table_10128185_2 WHERE total = 35 |
What was the lost with tries for? | CREATE TABLE table_12828723_5 (lost VARCHAR) | SELECT lost FROM table_12828723_5 WHERE "tries_for" = "tries_for" |
What is the 2nd round with a score of 3 - 3, and a team 1 fc gueugnon (d2)? | CREATE TABLE table_name_86 (score VARCHAR,team_1 VARCHAR) | SELECT 2 AS nd_round FROM table_name_86 WHERE score = "3 - 3" AND team_1 = "fc gueugnon (d2)" |
What is the record for the opponent the Cleveland Cavaliers? | CREATE TABLE table_43612 ("Game" real,"Date" text,"Opponent" text,"Score" text,"Location" text,"Record" text) | SELECT "Record" FROM table_43612 WHERE "Opponent" = 'cleveland cavaliers' |
what is the 1st round when team 2 is usl dunkerque (d2)? | CREATE TABLE table_name_73 (team_2 VARCHAR) | SELECT 1 AS st_round FROM table_name_73 WHERE team_2 = "usl dunkerque (d2)" |
What is the largest frequency owned by multicultural broadcasting with a Format of vietnamese? | CREATE TABLE table_14920 ("Station" text,"Frequency" real,"Network Affiliation" text,"Format" text,"City of License" text,"Status" text) | SELECT MAX("Frequency") FROM table_14920 WHERE "Status" = 'owned by multicultural broadcasting' AND "Format" = 'vietnamese' |
What year is the Grim Fandango with a windows platform? | CREATE TABLE table_79493 ("Year" real,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text) | SELECT "Year" FROM table_79493 WHERE "Platform(s)" = 'windows' AND "Game" = 'grim fandango' |
what is the number of patients whose ethnicity is black/african american and procedure short title is pericardiocentesis? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND procedures.short_title = "Pericardiocentesis" |
how many sections does each course has?, list by the Y in desc. | CREATE TABLE COURSE (CRS_CODE varchar(10),DEPT_CODE varchar(10),CRS_DESCRIPTION varchar(35),CRS_CREDIT float(8))CREATE TABLE EMPLOYEE (EMP_NUM int,EMP_LNAME varchar(15),EMP_FNAME varchar(12),EMP_INITIAL varchar(1),EMP_JOBCODE varchar(5),EMP_HIREDATE datetime,EMP_DOB datetime)CREATE TABLE ENROLL (CLASS_CODE varchar(5),S... | SELECT CRS_CODE, COUNT(*) FROM CLASS GROUP BY CRS_CODE ORDER BY COUNT(*) DESC |
How many companies each investor has invested? Show me a bar chart. | CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text) | SELECT Investor, COUNT(Investor) FROM entrepreneur GROUP BY Investor |
how many patients have been discharged from hospital until 2 years ago. | CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,even... | SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE NOT admissions.dischtime IS NULL AND DATETIME(admissions.dischtime) <= DATETIME(CURRENT_TIME(), '-2 year') |
Group by services attribute in station table and compute the total number of services with a bar chart, order by the services in ascending. | CREATE TABLE station (id int,network_name text,services text,local_authority text)CREATE TABLE weekly_weather (station_id int,day_of_week text,high_temperature int,low_temperature int,precipitation real,wind_speed_mph int)CREATE TABLE train (id int,train_number int,name text,origin text,destination text,time text,inter... | SELECT services, COUNT(services) FROM station GROUP BY services ORDER BY services |
What is the Musical Guest/Song with an original airdate of january 2008? | CREATE TABLE table_40938 ("Pilot" text,"Original Airdate" text,"Musical Guest/Song performed" text,"YouTube Hero" text,"MySpace Band" text) | SELECT "Musical Guest/Song performed" FROM table_40938 WHERE "Original Airdate" = 'january 2008' |
what is the number of patients born before 2137 who are still alive? | 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 WHERE demographic.expire_flag = "0" AND demographic.dob_year < "2137" |
What is the average tonnage of the ship named proletarij? | CREATE TABLE table_76361 ("Date" text,"Name of ship" text,"Flag" text,"Tonnage" real,"Fate" text) | SELECT AVG("Tonnage") FROM table_76361 WHERE "Name of ship" = 'proletarij' |
how many patients posses private insurance and are born before 2023? | 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,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.insurance = "Private" AND demographic.dob_year < "2023" |
What rank is Miller Barber with more than 11 wins? | CREATE TABLE table_name_35 (rank VARCHAR,wins VARCHAR,player VARCHAR) | SELECT rank FROM table_name_35 WHERE wins > 11 AND player = "miller barber" |
What country did the player who scored 73-73-65=211 come from? | CREATE TABLE table_name_6 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_6 WHERE score = 73 - 73 - 65 = 211 |
Which System's Name is Gemulator? | CREATE TABLE table_53113 ("Name" text,"Actual version" text,"System" text,"Platform" text,"License" text) | SELECT "System" FROM table_53113 WHERE "Name" = 'gemulator' |
What is the Draw number of the song by Artist of 'Loudest Whisper' with 68 or less Points with a place of 9 or larger? | CREATE TABLE table_name_63 (draw INTEGER,place VARCHAR,points VARCHAR,artist VARCHAR) | SELECT AVG(draw) FROM table_name_63 WHERE points < 68 AND artist = "loudest whisper" AND place > 9 |
Who is the player from Hotchkiss School with a position of d? | CREATE TABLE table_name_45 (player VARCHAR,position VARCHAR,team_from VARCHAR) | SELECT player FROM table_name_45 WHERE position = "d" AND team_from = "hotchkiss school" |
What classes qualify me to declare a major in LATINOAM ? | CREATE TABLE course_tags_count (course_id int,clear_grading int,pop_quiz int,group_projects int,inspirational int,long_lectures int,extra_credit int,few_tests int,good_feedback int,tough_tests int,heavy_papers int,cares_for_students int,heavy_assignments int,respected int,participation int,heavy_reading int,tough_grade... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE course.department LIKE '%LATINOAM%' AND program_course.category LIKE 'PreMajor' AND program_course.course_id = course.course_id |
compared to second measured on the first icu visit, is heart rate of patient 13897 greater than first measured on the first icu visit? | CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid... | SELECT (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 = 13897) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
What is the average 2007 value for a 2006 of 2.8 and 2009 under 20? | CREATE TABLE table_name_6 (Id VARCHAR) | SELECT AVG(2007) FROM table_name_6 WHERE 2009 < 20 AND 2006 = 2.8 |
what's the cost for a glucose, pleural laboratory test? | 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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid numb... | SELECT DISTINCT cost.cost FROM cost WHERE cost.event_type = 'labevents' AND cost.event_id IN (SELECT labevents.row_id FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'glucose, pleural')) |
What are the cities/towns located in the municipality of Moss? | CREATE TABLE table_72719 ("City/town" text,"Municipality" text,"County" text,"City/town status" real,"Population" real) | SELECT "City/town" FROM table_72719 WHERE "Municipality" = 'Moss' |
Which opponent has a Record of 4-5? | CREATE TABLE table_name_31 (opponent VARCHAR,record VARCHAR) | SELECT opponent FROM table_name_31 WHERE record = "4-5" |
What is the height of the building named 555 17th street? | CREATE TABLE table_75582 ("Name" text,"Street address" text,"Years as tallest" text,"Height ft / m" text,"Floors" real) | SELECT "Height ft / m" FROM table_75582 WHERE "Name" = '555 17th street' |
Which Date has a Time of 12:00? | CREATE TABLE table_name_80 (date VARCHAR,time VARCHAR) | SELECT date FROM table_name_80 WHERE time = "12:00" |
what player went to ul-monroe | CREATE TABLE table_name_7 (player VARCHAR,school VARCHAR) | SELECT player FROM table_name_7 WHERE school = "ul-monroe" |
is the heart rate of patient 25300 last measured on the first icu visit less than second to last measured on the first icu visit. | 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 d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE chartevents (row_id number,subject_id number,hadm_id number,icustay_id numbe... | SELECT (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 = 25300) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime LIMIT 1) AND chartevents.item... |
Do all senior level classes require exams ? | CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREAT... | SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%' |
Which Giro di Lombardia has a Paris Roubaix of servais knaven ( ned )? | CREATE TABLE table_name_38 (giro_di_lombardia VARCHAR,paris_roubaix VARCHAR) | SELECT giro_di_lombardia FROM table_name_38 WHERE paris_roubaix = "servais knaven ( ned )" |
Which song has a ending theme, and is sung by miriam yeung? | CREATE TABLE table_name_75 (name_of_the_song VARCHAR,kind_of_the_song VARCHAR,singer VARCHAR) | SELECT name_of_the_song FROM table_name_75 WHERE kind_of_the_song = "ending theme" AND singer = "miriam yeung" |
Which are the courses required for the major but not in the CLIMATE department ? | CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE area (course_id int,area varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course... | SELECT DISTINCT course.department, course.name, course.number FROM course, program, program_course WHERE course.department <> 'CLIMATE' AND program_course.course_id = course.course_id AND program.program_id = program_course.program_id |
Give me a histogram for what is the number of professors for different school?, could you order in asc by the x axis? | CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE PROFESSOR (EMP_NUM int,DEPT_CODE varchar(10),PROF_OFFICE varchar(50),PRO... | SELECT SCHOOL_CODE, COUNT(*) FROM DEPARTMENT AS T1 JOIN PROFESSOR AS T2 ON T1.DEPT_CODE = T2.DEPT_CODE GROUP BY T1.SCHOOL_CODE ORDER BY SCHOOL_CODE |
Name the kaz hayashi with block A of Shuji Kondo | CREATE TABLE table_name_47 (kaz_hayashi VARCHAR,block_a VARCHAR) | SELECT kaz_hayashi FROM table_name_47 WHERE block_a = "shuji kondo" |
yes or no for the auckland with a yes for sydney, no for perth, yes for melbourne and yes for the gold coast? | CREATE TABLE table_name_74 (auckland VARCHAR,gold_coast VARCHAR,melbourne VARCHAR,sydney VARCHAR,perth VARCHAR) | SELECT auckland FROM table_name_74 WHERE sydney = "yes" AND perth = "no" AND melbourne = "yes" AND gold_coast = "yes" |
could you please give me the cost of a round trip flight from DENVER to PITTSBURGH | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,basic_type varchar,engines int,propulsion varchar,wide_body varchar,wing_span int,length int,weight int,capacity int,pay_load int,cruising_speed int,range_m... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare 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_... |
Who is the athlete from the nation of Ethiopia (eth) who had a rank bigger than 7.0? | CREATE TABLE table_22355_20 (athlete VARCHAR,nation VARCHAR,rank VARCHAR) | SELECT athlete FROM table_22355_20 WHERE nation = "Ethiopia (ETH)" AND rank > 7.0 |
What are total salaries and department id for each department that has more than 2 employees? | CREATE TABLE employees (employee_id number,first_name text,last_name text,email text,phone_number text,hire_date time,job_id text,salary number,commission_pct number,manager_id number,department_id number)CREATE TABLE regions (region_id number,region_name text)CREATE TABLE locations (location_id number,street_address t... | SELECT department_id, SUM(salary) FROM employees GROUP BY department_id HAVING COUNT(*) >= 2 |
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of manager_id bin hire_date by weekday in a bar chart, and list in desc by the total number of manager id please. | 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 regions (REGION_ID decimal(5,0),REGIO... | SELECT HIRE_DATE, SUM(MANAGER_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(MANAGER_ID) DESC |
What is High Points, when High Rebounds is 'Dwight Howard (16)'? | CREATE TABLE table_76857 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text) | SELECT "High points" FROM table_76857 WHERE "High rebounds" = 'dwight howard (16)' |
For upper level electives , which courses count ? | 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_id varchar)CREATE TABLE ta (campus_job_id int,student_id int,locati... | SELECT DISTINCT course.department, course.name, course.number FROM course, program_course WHERE program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id |
Where was game 41 held, and how many people attended? | CREATE TABLE table_22883210_7 (location_attendance VARCHAR,game VARCHAR) | SELECT location_attendance FROM table_22883210_7 WHERE game = 41 |
Who was the owner in 1996 of trainer Nick Zito? | CREATE TABLE table_53832 ("Year" text,"Winner" text,"Jockey" text,"Trainer" text,"Owner" text,"Distance" text,"Time" text,"Purse" text) | SELECT "Owner" FROM table_53832 WHERE "Trainer" = 'nick zito' AND "Year" = '1996' |
uncontrolled high blood pressure ( >= 140 / 90 mmhg ) | CREATE TABLE table_train_259 ("id" int,"systolic_blood_pressure_sbp" int,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"hearing_problem" bool,"heart_disease" bool,"high_blood_pressure" bool,"diabetic" string,"immune_deficiency_disorder" bool,"visual_impairment" bool,"diastolic_blood_pressure_dbp" int,"NOUSE" float) | SELECT * FROM table_train_259 WHERE high_blood_pressure = 1 OR systolic_blood_pressure_sbp > 140 OR diastolic_blood_pressure_dbp > 90 |
What's the Loss listed with a Score of 5-1? | CREATE TABLE table_58247 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Loss" FROM table_58247 WHERE "Score" = '5-1' |
what is the number of patients whose age is less than 77 and drug code is nabc50i? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime te... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "77" AND prescriptions.formulary_drug_cd = "NABC50I" |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.