instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
who is at the top ? | CREATE TABLE table_204_174 (id number,"rank" number,"name" text,"nationality" text,"result" number,"notes" text) | SELECT "name" FROM table_204_174 WHERE id = 1 |
Show how many courses in 2008 for every instructor with a bar chart. | CREATE TABLE classroom (building varchar(15),room_number varchar(7),capacity numeric(4,0))CREATE TABLE course (course_id varchar(8),title varchar(50),dept_name varchar(20),credits numeric(2,0))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15),room_nu... | SELECT name, COUNT(name) FROM course AS T1 JOIN teaches AS T2 ON T1.course_id = T2.course_id JOIN instructor AS T3 ON T2.ID = T3.ID WHERE year = 2008 GROUP BY name |
What is the lowest amount of wins a manager with more than 0.526 pct., ranked higher than 37, and 947 losses has? | CREATE TABLE table_name_8 (wins INTEGER,losses VARCHAR,pct VARCHAR,rank VARCHAR) | SELECT MIN(wins) FROM table_name_8 WHERE pct > 0.526 AND rank < 37 AND losses = 947 |
Hows many Laps are in a Grid of 4? | CREATE TABLE table_51741 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT COUNT("Laps") FROM table_51741 WHERE "Grid" = '4' |
What is the to par when the year(s) won is larger than 1999? | CREATE TABLE table_79176 ("Player" text,"Country" text,"Year(s) won" real,"Total" real,"To par" text,"Finish" text) | SELECT "To par" FROM table_79176 WHERE "Year(s) won" > '1999' |
Gold of 1, and a Total smaller than 4, and a Bronze smaller than 0 has the lowest silver? | CREATE TABLE table_name_19 (silver INTEGER,bronze VARCHAR,gold VARCHAR,total VARCHAR) | SELECT MIN(silver) FROM table_name_19 WHERE gold = 1 AND total < 4 AND bronze < 0 |
Which tittles have an original air date of March 19, 1998 | CREATE TABLE table_11951237_4 (title VARCHAR,original_air_date VARCHAR) | SELECT title FROM table_11951237_4 WHERE original_air_date = "March 19, 1998" |
Who was the opponent that played on may 12? | CREATE TABLE table_name_32 (opponent VARCHAR,date VARCHAR) | SELECT opponent FROM table_name_32 WHERE date = "may 12" |
What are the names of accounts with checking balances greater than the average checking balance and savings balances below the average savings balance? | CREATE TABLE savings (custid number,balance number)CREATE TABLE accounts (custid number,name text)CREATE TABLE checking (custid number,balance number) | SELECT T1.name FROM accounts AS T1 JOIN checking AS T2 ON T1.custid = T2.custid WHERE T2.balance > (SELECT AVG(balance) FROM checking) INTERSECT SELECT T1.name FROM accounts AS T1 JOIN savings AS T2 ON T1.custid = T2.custid WHERE T2.balance < (SELECT AVG(balance) FROM savings) |
What was the overall score when the score for set 3 is 21 25? | CREATE TABLE table_9146 ("Date" text,"Time" text,"Score" text,"Set 1" text,"Set 2" text,"Set 3" text,"Total" text) | SELECT "Score" FROM table_9146 WHERE "Set 3" = '21–25' |
What is the relationship between Team_ID and All_Games_Percent , and group by attribute ACC_Regular_Season? | CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En... | SELECT Team_ID, All_Games_Percent FROM basketball_match GROUP BY ACC_Regular_Season |
What was the record when the Denver Broncos played the New York Titans at Bears Stadium? | CREATE TABLE table_61662 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Record" FROM table_61662 WHERE "Game site" = 'bears stadium' AND "Opponent" = 'new york titans' |
How many games were played against a team with a 9-19-6 record against the Islanders? | CREATE TABLE table_29625 ("Game" real,"December" real,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text,"Points" real) | SELECT COUNT("December") FROM table_29625 WHERE "Record" = '9-19-6' |
what was the name of the output, which patient 005-18714 had last on 07/21/last year? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number... | SELECT intakeoutput.celllabel FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '005-18714')) AND intakeoutput.cellpath LIKE '%output%' AND D... |
For each director, what is the title and score of their most poorly rated movie? | CREATE TABLE rating (rid number,mid number,stars number,ratingdate time)CREATE TABLE movie (mid number,title text,year number,director text)CREATE TABLE reviewer (rid number,name text) | SELECT T2.title, T1.stars, T2.director, MIN(T1.stars) FROM rating AS T1 JOIN movie AS T2 ON T1.mid = T2.mid GROUP BY T2.director |
Which Outcome has a Score of 3 6 2 6? | CREATE TABLE table_name_90 (outcome VARCHAR,score VARCHAR) | SELECT outcome FROM table_name_90 WHERE score = "3–6 2–6" |
Who was the replacement manager for the vacancy of 12 Dec 2009? | CREATE TABLE table_24912 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text) | SELECT "Replaced by" FROM table_24912 WHERE "Date of vacancy" = '12 Dec 2009' |
What was the date for the catalog 32xa-112? | CREATE TABLE table_name_42 (date VARCHAR,catalog VARCHAR) | SELECT date FROM table_name_42 WHERE catalog = "32xa-112" |
hiv or hepatitis c positive status; | CREATE TABLE table_train_171 ("id" int,"systolic_blood_pressure_sbp" int,"hiv_infection" bool,"hemoglobin_a1c_hba1c" float,"hepatitis_c" bool,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"triglyceride_tg" float,"NOUSE" float) | SELECT * FROM table_train_171 WHERE hiv_infection = 1 OR hepatitis_c = 1 |
What is the date of the match with a result of 4-0? | CREATE TABLE table_38218 ("Date" text,"Venue" text,"Score" text,"Result" text,"Competition" text) | SELECT "Date" FROM table_38218 WHERE "Result" = '4-0' |
In which district is the incumbent a republican first elected in 1998? | CREATE TABLE table_name_33 (district VARCHAR,party VARCHAR,first_elected VARCHAR) | SELECT district FROM table_name_33 WHERE party = "republican" AND first_elected = 1998 |
\What is the class of the station with the call sign w254ah? | CREATE TABLE table_name_35 (class VARCHAR,call_sign VARCHAR) | SELECT class FROM table_name_35 WHERE call_sign = "w254ah" |
Do you know anywhere that offers intelligent systems courses ? | CREATE TABLE student (student_id int,lastname varchar,firstname varchar,program_id int,declare_major varchar,total_credit int,total_gpa float,entered_as varchar,admit_term int,predicted_graduation_semester int,degree varchar,minor varchar,internship varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqna... | SELECT DISTINCT course.department, course.name, course.number FROM area, course WHERE area.area LIKE '%intelligent systems%' AND course.course_id = area.course_id |
since 12/2104, what was the daily minimum value of the pt of patient 31854? | CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE prescriptions (row_id number,subject_id number,hadm_id number,startdate time,enddate time,drug text,dose_val_rx t... | SELECT MIN(labevents.valuenum) FROM labevents WHERE labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 31854) AND labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'pt') AND STRFTIME('%y-%m', labevents.charttime) >= '2104-12' GROUP BY STRFT... |
How many times is the country ireland and points more than 4? | CREATE TABLE table_name_31 (vuelta_wins VARCHAR,country VARCHAR,points VARCHAR) | SELECT COUNT(vuelta_wins) FROM table_name_31 WHERE country = "ireland" AND points > 4 |
What are all the names of the players who are 7-0 tall? | CREATE TABLE table_11734041_10 (player VARCHAR,height_in_ft VARCHAR) | SELECT player FROM table_11734041_10 WHERE height_in_ft = "7-0" |
How many points are in the scored category for the team that has less than 5 draws, 8 total wins, and total overall points less than 27? | CREATE TABLE table_14005 ("Position" real,"Team" text,"Played" real,"Wins" real,"Draws" real,"Losses" real,"Scored" real,"Conceded" real,"Points" real) | SELECT COUNT("Scored") FROM table_14005 WHERE "Draws" < '5' AND "Wins" = '8' AND "Points" < '27' |
How many golds have a Total of 11, and a Bronze smaller than 3? | CREATE TABLE table_71807 ("Rank" real,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Gold") FROM table_71807 WHERE "Total" = '11' AND "Bronze" < '3' |
provide the number of patients whose admission type is emergency and diagnosis long title is other specified disorders of esophagus | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND diagnoses.long_title = "Other specified disorders of esophagus" |
What is the position when the League is the malaysian super league, and a Year of 2011? | CREATE TABLE table_68259 ("Year" text,"Position" text,"League" text,"FA Cup" text,"Malaysia Cup" text) | SELECT "Position" FROM table_68259 WHERE "League" = 'malaysian super league' AND "Year" = '2011' |
What is Years, when Win-Loss is 11-60? | CREATE TABLE table_name_55 (years VARCHAR,win_loss VARCHAR) | SELECT years FROM table_name_55 WHERE win_loss = "11-60" |
What is the 1st leg when team 2 is Asil Lysi? | CREATE TABLE table_name_91 (team_2 VARCHAR) | SELECT 1 AS st_leg FROM table_name_91 WHERE team_2 = "asil lysi" |
Show the first names and last names of all the guests that have apartment bookings with status code 'Confirmed'. | CREATE TABLE guests (guest_id number,gender_code text,guest_first_name text,guest_last_name text,date_of_birth time)CREATE TABLE apartments (apt_id number,building_id number,apt_type_code text,apt_number text,bathroom_count number,bedroom_count number,room_count text)CREATE TABLE apartment_bookings (apt_booking_id numb... | SELECT T2.guest_first_name, T2.guest_last_name FROM apartment_bookings AS T1 JOIN guests AS T2 ON T1.guest_id = T2.guest_id WHERE T1.booking_status_code = "Confirmed" |
What Competition has an Event of 4x100 m relay and has the Time of 38.89? | CREATE TABLE table_name_77 (competition VARCHAR,event VARCHAR,time VARCHAR) | SELECT competition FROM table_name_77 WHERE event = "4x100 m relay" AND time = "38.89" |
Which Netflix episode has an overall episode number under 69 and a Segment D of S Trombone? | CREATE TABLE table_name_92 (netflix VARCHAR,episode VARCHAR,segment_d VARCHAR) | SELECT netflix FROM table_name_92 WHERE episode < 69 AND segment_d = "s trombone" |
Tell me the average 1st prize for tennessee | CREATE TABLE table_57453 ("Date" text,"Tournament" text,"Location" text,"Purse($)" real,"Winner" text,"Score" text,"1st Prize($)" real) | SELECT AVG("1st Prize( $ )") FROM table_57453 WHERE "Location" = 'tennessee' |
College of lsu has how many rounds? | CREATE TABLE table_79862 ("Round" real,"Pick #" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT COUNT("Round") FROM table_79862 WHERE "College" = 'lsu' |
Which course had a mountain stage type on 3 June? | CREATE TABLE table_11706 ("Date" text,"Course" text,"Distance" text,"Type" text,"Winner" text) | SELECT "Course" FROM table_11706 WHERE "Type" = 'mountain stage' AND "Date" = '3 june' |
Which game has the highest score in October with 9? | CREATE TABLE table_75610 ("Game" real,"October" real,"Opponent" text,"Score" text,"Record" text) | SELECT MAX("October") FROM table_75610 WHERE "Game" = '9' |
What lowest round has orlando pace as the player? | CREATE TABLE table_name_3 (round INTEGER,player VARCHAR) | SELECT MIN(round) FROM table_name_3 WHERE player = "orlando pace" |
Show total hours per week and number of games played for student David Shieber. | CREATE TABLE Student (StuID VARCHAR,Fname VARCHAR,Lname VARCHAR)CREATE TABLE Sportsinfo (StuID VARCHAR) | SELECT SUM(hoursperweek), SUM(gamesplayed) FROM Sportsinfo AS T1 JOIN Student AS T2 ON T1.StuID = T2.StuID WHERE T2.Fname = "David" AND T2.Lname = "Shieber" |
who is the last player listed ? | CREATE TABLE table_203_692 (id number,"name" text,"pos." text,"caps" number,"goals" number,"club" text) | SELECT "name" FROM table_203_692 ORDER BY id DESC LIMIT 1 |
What is the largest number for karianne gulliksen? | CREATE TABLE table_28677723_5 (karianne_gulliksen INTEGER) | SELECT MAX(karianne_gulliksen) FROM table_28677723_5 |
What position does the player from the Miami University (CCHA) club team play? | CREATE TABLE table_name_20 (position VARCHAR,club_team VARCHAR) | SELECT position FROM table_name_20 WHERE club_team = "miami university (ccha)" |
how many patients were prescribed hydromorphone within 2 months during this year after the diagnosis with congestive heart failure? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsyste... | SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'congestive heart failure' AND DATETIME(diagnosis.diagnosistime, 'start of year') = DATETIME(CURRENT_TIME(), ... |
which year was responsible for 4,140 deaths ? | CREATE TABLE table_200_10 (id number,"year" number,"deaths" number,"# of accidents" number) | SELECT "year" FROM table_200_10 WHERE "deaths" = 4140 |
find the number of divorced patients who have blood gas lab test category. | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "DIVORCED" AND lab."CATEGORY" = "Blood Gas" |
What is the position of the song thar genjor mcnell performed? | CREATE TABLE table_2917 ("Artist" text,"Song (English translation)" text,"Songwriter(s)" text,"Position" real,"Date Eliminated" text) | SELECT "Position" FROM table_2917 WHERE "Artist" = 'Genjor McNell' |
Which city has the least number of customers whose type code is 'Good Credit Rating'? | CREATE TABLE staff (staff_id number,gender text,first_name text,last_name text,email_address text,phone_number text)CREATE TABLE customers (customer_id number,customer_type_code text,address_line_1 text,address_line_2 text,town_city text,state text,email_address text,phone_number text)CREATE TABLE complaints (complaint... | SELECT town_city FROM customers WHERE customer_type_code = "Good Credit Rating" GROUP BY town_city ORDER BY COUNT(*) LIMIT 1 |
Which Surface has a Score of 6 4, 6 2? | CREATE TABLE table_36764 ("Outcome" text,"Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text) | SELECT "Surface" FROM table_36764 WHERE "Score" = '6–4, 6–2' |
show me the top three most common output events until 2101? | CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE patient (uniquepid text,patienthealthsystemstayi... | SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%output%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) <= '2101' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 3 |
what AAA class has a school year of 1989-90? | CREATE TABLE table_36555 ("School Year" text,"Class A" text,"Class AA" text,"Class AAA" text,"Class AAAA" text,"Class AAAAA" text) | SELECT "Class AAA" FROM table_36555 WHERE "School Year" = '1989-90' |
What is the name and distance for aircraft with id 12? | CREATE TABLE Aircraft (name VARCHAR,distance VARCHAR,aid VARCHAR) | SELECT name, distance FROM Aircraft WHERE aid = 12 |
give the number of patients whose admission location is phys referral/normal deli and drug code is baci15o. | 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 text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.formulary_drug_cd = "BACI15O" |
is the hgb level of patient 002-54808 last measured on the first hospital visit less than first measured on the first hospital visit? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE patient (uniquepid text,patienthealthsystemsta... | SELECT (SELECT lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-54808' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospi... |
Who was the away team for the game with a score of 139-119? | CREATE TABLE table_9706 ("Date" text,"Home team" text,"Score" text,"Away team" text,"Venue" text,"Box Score" text,"Report" text) | SELECT "Away team" FROM table_9706 WHERE "Score" = '139-119' |
What subdivision names (RU) have a code of by-hr? | CREATE TABLE table_290017_1 (subdivision_name___ru____bgn_pcgn_ VARCHAR,code VARCHAR) | SELECT subdivision_name___ru____bgn_pcgn_ FROM table_290017_1 WHERE code = "BY-HR" |
Please give me a bar chart to show the distribution of results of all music festival, and show by the x axis from low to high please. | CREATE TABLE artist (Artist_ID int,Artist text,Age int,Famous_Title text,Famous_Release_date text)CREATE TABLE music_festival (ID int,Music_Festival text,Date_of_ceremony text,Category text,Volume int,Result text)CREATE TABLE volume (Volume_ID int,Volume_Issue text,Issue_Date text,Weeks_on_Top real,Song text,Artist_ID ... | SELECT Result, COUNT(Result) FROM music_festival GROUP BY Result ORDER BY Result |
Tell me the calls for frequency of 1290 khz | CREATE TABLE table_31965 ("Calls" text,"Frequency" text,"Branding" text,"Format" text,"Timeslot" text,"Group owner" text) | SELECT "Calls" FROM table_31965 WHERE "Frequency" = '1290 khz' |
For all employees who have the letters D or S in their first name, draw a bar chart about the distribution of job_id and the sum of department_id , and group by attribute job_id, I want to sort by the sum department id from low to high. | CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2),COMMISSION_PCT decimal(2,2),MANAGE... | SELECT JOB_ID, SUM(DEPARTMENT_ID) FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' GROUP BY JOB_ID ORDER BY SUM(DEPARTMENT_ID) |
How many womens singles entries are there when womens doubles is li xiaodan wen jia? | CREATE TABLE table_28138035_27 (womens_singles VARCHAR,womens_doubles VARCHAR) | SELECT COUNT(womens_singles) FROM table_28138035_27 WHERE womens_doubles = "Li Xiaodan Wen Jia" |
What is the total for the year (s) won in 1977? | CREATE TABLE table_12195 ("Player" text,"Country" text,"Year(s) won" text,"Total" real,"To par" real) | SELECT "Total" FROM table_12195 WHERE "Year(s) won" = '1977' |
What is the average salary for each job title. Show bar chart. | 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 departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE regions (RE... | SELECT JOB_TITLE, AVG(SALARY) FROM employees AS T1 JOIN jobs AS T2 ON T1.JOB_ID = T2.JOB_ID GROUP BY T2.JOB_TITLE |
Who was No. 3 when No. 5 James and No. 6 Mason? | CREATE TABLE table_name_35 (no_3 VARCHAR,no_5 VARCHAR,no_6 VARCHAR) | SELECT no_3 FROM table_name_35 WHERE no_5 = "james" AND no_6 = "mason" |
What is the lowest Game, when Date is 'November 1'? | CREATE TABLE table_77158 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT MIN("Game") FROM table_77158 WHERE "Date" = 'november 1' |
Look for a word or substring in user profiles. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,Po... | SELECT * FROM Users WHERE AboutMe LIKE '%' + '##Text##' + '%' |
Give me a bar chart showing the number of products supplied by supplier id 3 for different product type code. | CREATE TABLE Staff_Department_Assignments (staff_id INTEGER,department_id INTEGER,date_assigned_from DATETIME,job_title_code VARCHAR(10),date_assigned_to DATETIME)CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_purchased VARCHAR(8... | SELECT product_type_code, COUNT(product_type_code) FROM Product_Suppliers AS T1 JOIN Products AS T2 ON T1.product_id = T2.product_id WHERE T1.supplier_id = 3 GROUP BY product_type_code |
What is the proportion of the average base price of the rooms for each different decor? Show me a pie chart! | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT decor, AVG(basePrice) FROM Rooms GROUP BY decor |
What is the listed Status that has the Province of Ontario and Rank of 86? | CREATE TABLE table_name_19 (status VARCHAR,province VARCHAR,rank VARCHAR) | SELECT status FROM table_name_19 WHERE province = "ontario" AND rank = 86 |
In how many districts was the democratic incumbent elected in 1974? | CREATE TABLE table_18218 ("District" text,"Incumbent" text,"Party" text,"Elected" real,"Status" text,"Opponent" text) | SELECT COUNT("District") FROM table_18218 WHERE "Party" = 'Democratic' AND "Elected" = '1974' |
when was the first time patient 018-118331 has been diagnosed with upper respiratory obstruction - suspected in this year? | CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT diagnosis.diagnosistime FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '018-118331')) AND diagnosis.diagnosisname = 'upper respiratory ob... |
What is the highest amount of points with a goal average larger than 4, less than 12 draws, and a goal of 63? | CREATE TABLE table_47493 ("Rank" real,"Club" text,"Points" real,"Played" real,"Victories" real,"Draws" real,"Defeats" real,"Goals for" real,"Goals against" real,"Goal average" real) | SELECT MAX("Points") FROM table_47493 WHERE "Goal average" > '4' AND "Draws" < '12' AND "Goals for" = '63' |
patient 016-29746's temperature during this month was normal? | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT COUNT(*) > 0 FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-29746')) AND vitalperiodic.temperature BETWEEN temperature_lower... |
how many titles have the name 'quick callanetics'? | CREATE TABLE table_11222744_3 (catalog_number VARCHAR,title VARCHAR) | SELECT COUNT(catalog_number) FROM table_11222744_3 WHERE title = "Quick Callanetics" |
What is the broadcast date of the episode on 16mm t/r that ran 23:25? | CREATE TABLE table_2101431_1 (broadcast_date VARCHAR,archive VARCHAR,run_time VARCHAR) | SELECT broadcast_date FROM table_2101431_1 WHERE archive = "16mm t/r" AND run_time = "23:25" |
How many million U.S. viewers watched the epiode with a production code of 1arc12? | CREATE TABLE table_27979 ("No. in series" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "U.S. viewers (million)" FROM table_27979 WHERE "Production code" = '1ARC12' |
How many figures are given for the Socialists in the case where the Social Democrats received 42.2%? | CREATE TABLE table_1958 ("Date Released" text,"Polling institute" text,"Social Democratic" text,"Socialist" text,"Green-Communist" text,"Peoples Party" text,"Left Bloc" text,"Lead" text) | SELECT COUNT("Socialist") FROM table_1958 WHERE "Social Democratic" = '42.2%' |
For 499 , next semester , will Prof. Frank Anderson be teaching the class ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)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,... | SELECT COUNT(*) > 0 FROM course, course_offering, instructor, offering_instructor, semester WHERE course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 499 AND instructor.name LIKE '%Frank Anderson%' AND offering_instructor.instructor_id = instructor.instructor_id AND offering_... |
What is the last name of the musician that have produced the most number of songs? | CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE performance (songid number,bandmate number,stageposition text)CREATE TABLE vocals (songid number,bandmate number,type text)CREATE TABLE songs (songid number,title text)CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE ... | SELECT T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid GROUP BY lastname ORDER BY COUNT(*) DESC LIMIT 1 |
Show me the average of baseprice by bedtype in a histogram, and could you sort in ascending by the bars? | CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER) | SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY bedType |
What is the Tournament when the 2013 is 1r? | CREATE TABLE table_name_54 (tournament VARCHAR) | SELECT tournament FROM table_name_54 WHERE 2013 = "1r" |
What is the name and description for document type code RV? | CREATE TABLE roles (role_code text,role_name text,role_description text)CREATE TABLE employees (employee_id number,role_code text,employee_name text,gender_mfu text,date_of_birth time,other_details text)CREATE TABLE ref_locations (location_code text,location_name text,location_description text)CREATE TABLE documents_to... | SELECT document_type_name, document_type_description FROM ref_document_types WHERE document_type_code = "RV" |
What competition has a result of W on June 30, 1966? | CREATE TABLE table_75051 ("Date" text,"Result" text,"Score" text,"Brazil scorers" text,"Competition" text) | SELECT "Competition" FROM table_75051 WHERE "Result" = 'w' AND "Date" = 'june 30, 1966' |
what is days of hospital stay and diagnoses short title of subject id 87275? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id tex... | SELECT demographic.days_stay, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "87275" |
What is the average rank of someone who earned smaller than 3,069,633? | CREATE TABLE table_51676 ("Rank" real,"Player" text,"Country" text,"Earnings($)" real,"Wins" real) | SELECT AVG("Rank") FROM table_51676 WHERE "Earnings( $ )" < '3,069,633' |
Segment B of aerospace fuel lines has what segment A? | CREATE TABLE table_75009 ("Series Ep." text,"Episode" real,"Netflix" text,"Segment A" text,"Segment B" text,"Segment C" text,"Segment D" text) | SELECT "Segment A" FROM table_75009 WHERE "Segment B" = 'aerospace fuel lines' |
who had the largest win percentage ? | CREATE TABLE table_204_342 (id number,"#" number,"player" text,"span" text,"caps" number,"total caps" number,"win %" text) | SELECT "player" FROM table_204_342 ORDER BY "win %" DESC LIMIT 1 |
who was the youngest delegate for miss dominican republic in 2002 ? | CREATE TABLE table_203_791 (id number,"represented" text,"contestant" text,"age" number,"height" text,"hometown" text) | SELECT "contestant" FROM table_203_791 ORDER BY "age" LIMIT 1 |
in 1833, how many institutions were created? | CREATE TABLE table_261895_1 (institution VARCHAR,founded VARCHAR) | SELECT COUNT(institution) FROM table_261895_1 WHERE founded = 1833 |
how many patients whose ethnicity is white - russian and lab test name is troponin i? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.ethnicity = "WHITE - RUSSIAN" AND lab.label = "Troponin I" |
What's Javagal Srinath's batting style? | CREATE TABLE table_17265 ("No." text,"Player" text,"Date of Birth" text,"Batting Style" text,"Bowling Style" text,"First Class Team" text) | SELECT "Batting Style" FROM table_17265 WHERE "Player" = 'Javagal Srinath' |
What position does Maryland have a player for Round 3? | CREATE TABLE table_name_81 (position VARCHAR,school_club_team VARCHAR,round VARCHAR) | SELECT position FROM table_name_81 WHERE school_club_team = "maryland" AND round = 3 |
tell me about the ground transportation from NASHVILLE airport | CREATE TABLE airport (airport_code varchar,airport_name text,airport_location text,state_code varchar,country_name varchar,time_zone_code varchar,minimum_connect_time int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days text,stop_airport text,arrival_time int,arrival_airline text,arrival_flight_number ... | SELECT DISTINCT ground_service.transport_type FROM city, ground_service WHERE city.city_name = 'NASHVILLE' AND ground_service.city_code = city.city_code |
Name the most year built for davik kyrkje | CREATE TABLE table_1779 ("Parish (Prestegjeld)" text,"Sub-Parish (Sokn)" text,"Church Name" text,"Year Built" real,"Location of the Church" text) | SELECT MAX("Year Built") FROM table_1779 WHERE "Church Name" = 'Davik Kyrkje' |
Give me the comparison about the average of ID over the Nationality , and group by attribute Nationality by a bar chart, rank by the Y in descending. | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE swimmer (ID int,name text,Nationality text,meter_100 real,meter_200 text,meter_300 text,meter_400 text,meter_500 text,meter_600 text,meter_700 text,Time text)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)CREATE TABLE stadiu... | SELECT Nationality, AVG(ID) FROM swimmer GROUP BY Nationality ORDER BY AVG(ID) DESC |
what is the drug name and drug route of Colton Andrade? | 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 prescriptions.drug, prescriptions.route FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Colton Andrade" |
What Club in Pizzighettone has a Capacity of 10,000 or greater? | CREATE TABLE table_13216 ("Club" text,"City" text,"Stadium" text,"Capacity" real,"2007\u201308 season" text) | SELECT "Club" FROM table_13216 WHERE "Capacity" > '10,000' AND "City" = 'pizzighettone' |
What is the lowest swimsuit for a contestant with an average of 9.125? | CREATE TABLE table_name_38 (swimsuit INTEGER,average VARCHAR) | SELECT MIN(swimsuit) FROM table_name_38 WHERE average = 9.125 |
what is the number of patients whose hospital stay is above 7 days and diagnosed with single ib in-hosp w cs? | 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 INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.days_stay > "7" AND diagnoses.short_title = "Single lb in-hosp w cs" |
Compare the total number of captains with different classes using a bar graph, show by the Class in ascending. | CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text)CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text) | SELECT Class, COUNT(Class) FROM captain GROUP BY Class ORDER BY Class |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.