instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
What are all values for 'to par' for the winning score of 67-67-69-69=272? | CREATE TABLE table_19845 ("No." real,"Date" text,"Tournament" text,"Winning score" text,"To par" text,"Margin of victory" text,"Runner-up" text) | SELECT "To par" FROM table_19845 WHERE "Winning score" = '67-67-69-69=272' |
what is the maximum hospital cost for a drug with a name called amiodarone 200 mg tab since 5 years ago? | CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventi... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT medication.patientunitstayid FROM medication WHERE medication.drugname = 'amiodarone 200 mg tab')) AND DATETIME(cost.cha... |
A bar chart for what are the number of the enrollment dates of all the tests that have result 'Pass'?, I want to show by the the number of date of enrolment in descending. | CREATE TABLE Course_Authors_and_Tutors (author_id INTEGER,author_tutor_ATB VARCHAR(3),login_name VARCHAR(40),password VARCHAR(40),personal_name VARCHAR(80),middle_name VARCHAR(80),family_name VARCHAR(80),gender_mf VARCHAR(1),address_line_1 VARCHAR(80))CREATE TABLE Student_Course_Enrolment (registration_id INTEGER,stude... | SELECT date_of_enrolment, COUNT(date_of_enrolment) FROM Student_Course_Enrolment AS T1 JOIN Student_Tests_Taken AS T2 ON T1.registration_id = T2.registration_id WHERE T2.test_result = "Pass" ORDER BY COUNT(date_of_enrolment) DESC |
What is the figure for Tujunga when Pasadena is 134,941? | CREATE TABLE table_name_39 (tujunga VARCHAR,pasadena VARCHAR) | SELECT tujunga FROM table_name_39 WHERE pasadena = "134,941" |
What month is the Paris 20k Road Race held? | CREATE TABLE table_28348 ("Road race" text,"Distance" text,"Location" text,"Country" text,"Month held" text) | SELECT "Month held" FROM table_28348 WHERE "Location" = 'Paris' |
Can I get a list of Italian Romanticism courses that satisfy the Other requirement ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,r... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Italian Romanticism%' OR course.description LIKE '%Italian Romanticism%' OR course.name LIKE '%I... |
A bar chart about how many captains are in each rank? | CREATE TABLE captain (Captain_ID int,Name text,Ship_ID int,age text,Class text,Rank text)CREATE TABLE Ship (Ship_ID int,Name text,Type text,Built_Year real,Class text,Flag text) | SELECT Rank, COUNT(*) FROM captain GROUP BY Rank |
TAIL papers used in NIPS | CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE paperdataset (paperid int,datasetid int)CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE field (fieldid int)CREATE TABLE keyphrase (keyphraseid int,keyphrasename varchar)CREATE ... | SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase, venue WHERE keyphrase.keyphrasename = 'TAIL' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND venue.venueid = paper.venueid AND venue.venuename = 'NIPS' |
give me the number of patients whose admission year is less than 2131 and procedure icd9 code is 3895? | 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 INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admityear < "2131" AND procedures.icd9_code = "3895" |
For those employees who was hired before 2002-06-21, give me the comparison about the sum of salary over the job_id , and group by attribute job_id, and could you rank by the x axis in desc? | 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 locations (LOCATION_ID decimal(4,0),S... | SELECT JOB_ID, SUM(SALARY) FROM employees WHERE HIRE_DATE < '2002-06-21' GROUP BY JOB_ID ORDER BY JOB_ID DESC |
What was the maximum total USD collected by Pebble Technology? | CREATE TABLE table_27155990_1 (total_usd INTEGER,creator VARCHAR) | SELECT MAX(total_usd) FROM table_27155990_1 WHERE creator = "Pebble Technology" |
What is the result where the opponent is Columbus Destroyers? | CREATE TABLE table_57325 ("Week" real,"Date" text,"Opponent" text,"Home/Away Game" text,"Result" text) | SELECT "Result" FROM table_57325 WHERE "Opponent" = 'columbus destroyers' |
What are the different parties of representative? Show the party name and the number of representatives in each party, and could you show total number in descending order? | CREATE TABLE election (Election_ID int,Representative_ID int,Date text,Votes real,Vote_Percent real,Seats real,Place real)CREATE TABLE representative (Representative_ID int,Name text,State text,Party text,Lifespan text) | SELECT Party, COUNT(*) FROM representative GROUP BY Party ORDER BY COUNT(*) DESC |
For those records from the products and each product's manufacturer, give me the comparison about the sum of price over the name , and group by attribute name, sort by the Name in descending. | CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL) | SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name ORDER BY T1.Name DESC |
Show the sum of price supplied by supplier id 3 for different product type code in a bar chart, and sort from high to low by the bars please. | CREATE TABLE Order_Items (order_item_id INTEGER,order_id INTEGER,product_id INTEGER)CREATE TABLE Customers (customer_id INTEGER,payment_method_code VARCHAR(10),customer_code VARCHAR(20),customer_name VARCHAR(80),customer_address VARCHAR(255),customer_phone VARCHAR(80),customer_email VARCHAR(80))CREATE TABLE Suppliers (... | SELECT product_type_code, SUM(product_price) 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 ORDER BY product_type_code DESC |
Users with most Revival badges. Most decorated users | CREATE TABLE ReviewTaskResults (Id number,ReviewTaskId number,ReviewTaskResultTypeId number,CreationDate time,RejectionReasonId number,Comment text)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,W... | SELECT UserId AS "user_link", COUNT(*) AS Badges FROM Badges WHERE Badges.Name = 'Necromancer' OR Badges.Name = 'Revival' GROUP BY UserId ORDER BY Badges DESC LIMIT 100 |
Does it have something interesting about the manager id and the department id? | CREATE TABLE jobs (JOB_ID varchar(10),JOB_TITLE varchar(35),MIN_SALARY decimal(6,0),MAX_SALARY decimal(6,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 decima... | SELECT T1.MANAGER_ID, T1.DEPARTMENT_ID FROM employees AS T1 JOIN departments AS T2 ON T1.DEPARTMENT_ID = T2.DEPARTMENT_ID WHERE T1.EMPLOYEE_ID = T2.MANAGER_ID |
what was the opposition where the field is waldstadion during time 6 | CREATE TABLE table_27893892_2 (opponent VARCHAR,game_site VARCHAR,week VARCHAR) | SELECT opponent FROM table_27893892_2 WHERE game_site = "Waldstadion" AND week = 6 |
What locations did sid o'neill play football? | CREATE TABLE table_1474 ("Player" text,"VFL Games" real,"VFL Club(s)" text,"Rank held at time of death" text,"Date of death" text,"Location" text) | SELECT "Location" FROM table_1474 WHERE "Player" = 'Sid O''Neill' |
List the most common type of Status across cities. | CREATE TABLE farm (farm_id number,year number,total_horses number,working_horses number,total_cattle number,oxen number,bulls number,cows number,pigs number,sheep_and_goats number)CREATE TABLE city (city_id number,official_name text,status text,area_km_2 number,population number,census_ranking text)CREATE TABLE competi... | SELECT status FROM city GROUP BY status ORDER BY COUNT(*) DESC LIMIT 1 |
what is the manner of departure when the date of vacancy is 15 september 2008? | CREATE TABLE table_13547 ("Team" text,"Outgoing manager" text,"Manner of departure" text,"Date of vacancy" text,"Replaced by" text,"Date of appointment" text,"Position in table" text) | SELECT "Manner of departure" FROM table_13547 WHERE "Date of vacancy" = '15 september 2008' |
Which 2013 14 has a Rank 2014 smaller than 23, and a 2011 12 larger than 19.1, and a Rank 2013 of 14? | CREATE TABLE table_58617 ("Rank 2014" real,"Rank 2013" real,"Mvmt" text,"Club" text,"Country" text,"2009\u201310" real,"2010\u201311" real,"2011\u201312" real,"2012\u201313" real,"2013\u201314" real,"Coeff." real) | SELECT AVG("2013\u201314") FROM table_58617 WHERE "Rank 2014" < '23' AND "2011\u201312" > '19.1' AND "Rank 2013" = '14' |
What is the zip code of staff with first name as Janessa and last name as Sawayn lived? | CREATE TABLE Addresses (zip_postcode VARCHAR,address_id VARCHAR)CREATE TABLE Staff (staff_address_id VARCHAR,first_name VARCHAR,last_name VARCHAR) | SELECT T1.zip_postcode FROM Addresses AS T1 JOIN Staff AS T2 ON T1.address_id = T2.staff_address_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn" |
when does the train arriving at stamford east at 11.45 departure | CREATE TABLE table_22278 ("Departure" text,"Going to" text,"Calling at" text,"Arrival" text,"Operator" text) | SELECT "Departure" FROM table_22278 WHERE "Arrival" = '11.45' AND "Going to" = 'Stamford East' |
What is the bullet weight when the max pressure is 12,000 cup? | CREATE TABLE table_173103_1 (bullet_weight VARCHAR,max_pressure VARCHAR) | SELECT bullet_weight FROM table_173103_1 WHERE max_pressure = "12,000 CUP" |
What is the IATA for the city of Amsterdam? | CREATE TABLE table_68833 ("City" text,"Country" text,"IATA" text,"ICAO" text,"Airport" text) | SELECT "IATA" FROM table_68833 WHERE "City" = 'amsterdam' |
what were the three most frequent drugs that were prescribed during the same month to the patients of age 30s after having been diagnosed with copd until 3 years ago? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patien... | SELECT t3.drugname FROM (SELECT t2.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'copd' AND DATETIME(diagnosis.diagnosistime) <= DAT... |
Most recent comments on my posts. | CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownCon... | SELECT c.Id AS "comment_link", c.Text, c.UserId AS "user_link", c.CreationDate FROM Comments AS c INNER JOIN Posts AS p ON c.PostId = p.Id WHERE (p.OwnerUserId = '##UserId?8297##') ORDER BY c.CreationDate DESC LIMIT 100 |
What course did Fergal Lynch end up with 5/1 odds? | CREATE TABLE table_name_34 (course VARCHAR,jockey VARCHAR,odds VARCHAR) | SELECT course FROM table_name_34 WHERE jockey = "fergal lynch" AND odds = "5/1" |
What is the ethernet ports of the u10 appliance? | CREATE TABLE table_43383 ("Name" text,"Processor" text,"Hard Drive" text,"Ethernet Ports" text,"Dimensions" text) | SELECT "Ethernet Ports" FROM table_43383 WHERE "Name" = 'u10' |
count the number of visits to the icu of patient 27242 since 3 years ago. | 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 icustays (row_id number,subject_id number,hadm_id number,icustay_id number,first_careunit text,last_careunit text,first_wardid number,last_wardid nu... | SELECT COUNT(DISTINCT icustays.icustay_id) FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 27242) AND DATETIME(icustays.intime) >= DATETIME(CURRENT_TIME(), '-3 year') |
When was Quantum Research's poll conducted? | CREATE TABLE table_20683381_2 (date_of_opinion_poll VARCHAR,conductor VARCHAR) | SELECT date_of_opinion_poll FROM table_20683381_2 WHERE conductor = "Quantum Research" |
What are the names, address roads, and cities of the branches ordered by opening year? | CREATE TABLE branch (branch_id number,name text,open_year text,address_road text,city text,membership_amount text)CREATE TABLE purchase (member_id number,branch_id text,year text,total_pounds number)CREATE TABLE membership_register_branch (member_id number,branch_id text,register_year text)CREATE TABLE member (member_i... | SELECT name, address_road, city FROM branch ORDER BY open_year |
Who's the writer of the episode see by 12.13 million US viewers? | CREATE TABLE table_12159115_2 (written_by VARCHAR,us_viewers__millions_ VARCHAR) | SELECT written_by FROM table_12159115_2 WHERE us_viewers__millions_ = "12.13" |
Programming languages trends - inc. related tags. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score nu... | SELECT YEAR(p.CreationDate), 100.0 * SUM(CASE WHEN t.Id IN (5, 21, 382, 75151, 3988, 57799, 106940, 114990, 8945, 8279, 14642, 984, 1581, 92312, 1661, 3437, 104777, 60676, 105840, 7528, 112569, 120888, 357, 78546, 26762, 3262, 63960, 98900, 99724, 2290, 66821, 1380, 81001, 5505, 107832, 85709, 2857, 72364, 44230, 38663... |
What is the total number of rank for the country of greece? | CREATE TABLE table_65512 ("Rank" real,"Rowers" text,"Country" text,"Time" text,"Notes" text) | SELECT COUNT("Rank") FROM table_65512 WHERE "Country" = 'greece' |
What regulations have hudson as the winning constructor? | CREATE TABLE table_name_84 (regulations VARCHAR,winning_constructor VARCHAR) | SELECT regulations FROM table_name_84 WHERE winning_constructor = "hudson" |
what was the name of the medicine that patient 60180 was prescribed with after having had a inj/inf platelet inhibit procedure in 09/2104 within 2 days? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)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 admissions (row_id number,subject_id number,hadm_id number,admitt... | SELECT t2.drug FROM (SELECT admissions.subject_id, procedures_icd.charttime FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE admissions.subject_id = 60180 AND procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = ... |
What was the GF attendance at the location of Sydney Football Stadium, Sydney (6)? | CREATE TABLE table_11236195_2 (gf_attendance VARCHAR,location VARCHAR) | SELECT COUNT(gf_attendance) FROM table_11236195_2 WHERE location = "Sydney Football Stadium, Sydney (6)" |
Which Avg/G has a Name of david allen, and a Gain larger than 371? | CREATE TABLE table_name_60 (avg_g INTEGER,name VARCHAR,gain VARCHAR) | SELECT AVG(avg_g) FROM table_name_60 WHERE name = "david allen" AND gain > 371 |
What country has the t7 place, and player Peter Oosterhuis? | CREATE TABLE table_59901 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Country" FROM table_59901 WHERE "Place" = 't7' AND "Player" = 'peter oosterhuis' |
What position has a 2-6 agg.? | CREATE TABLE table_76697 ("Position" text,"Team #1" text,"Agg." text,"Team #2" text,"1st leg" text,"2nd leg" text) | SELECT "Position" FROM table_76697 WHERE "Agg." = '2-6' |
What is the size that has nickel as the metal, and one rupee as the denomination? | CREATE TABLE table_name_46 (size VARCHAR,metal VARCHAR,denomination VARCHAR) | SELECT size FROM table_name_46 WHERE metal = "nickel" AND denomination = "one rupee" |
What is the smallest numbered episode in the series listed? | CREATE TABLE table_27547668_3 (_number INTEGER) | SELECT MIN(_number) FROM table_27547668_3 |
List all customer status codes and the number of customers having each status code, order from high to low by the y-axis. | CREATE TABLE Vehicles (vehicle_id INTEGER,vehicle_details VARCHAR(255))CREATE TABLE Customers (customer_id INTEGER,customer_address_id INTEGER,customer_status_code VARCHAR(15),date_became_customer DATETIME,date_of_birth DATETIME,first_name VARCHAR(80),last_name VARCHAR(80),amount_outstanding DOUBLE,email_address VARCHA... | SELECT customer_status_code, COUNT(*) FROM Customers GROUP BY customer_status_code ORDER BY COUNT(*) DESC |
Which Games played has a Points of 6, and Goals scored larger than 12? | CREATE TABLE table_name_83 (games_played INTEGER,points VARCHAR,goals_scored VARCHAR) | SELECT MAX(games_played) FROM table_name_83 WHERE points = 6 AND goals_scored > 12 |
What was the distance on 24 May? | CREATE TABLE table_name_83 (distance VARCHAR,date VARCHAR) | SELECT distance FROM table_name_83 WHERE date = "24 may" |
Which method did pride bushido 10 have ? | CREATE TABLE table_name_56 (method VARCHAR,event VARCHAR) | SELECT method FROM table_name_56 WHERE event = "pride bushido 10" |
What percent of respondents had no opinion on George H.W. Bush? | CREATE TABLE table_name_84 (george_h_w_bush VARCHAR,result VARCHAR) | SELECT george_h_w_bush FROM table_name_84 WHERE result = "no opinion" |
In what week was the record 5-9? | CREATE TABLE table_13258972_2 (week INTEGER,record VARCHAR) | SELECT MAX(week) FROM table_13258972_2 WHERE record = "5-9" |
get the id of the patients who had been diagnosed with hy kid nos w cr kid i-iv until 1 year ago. | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE procedures_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 TABL... | SELECT admissions.subject_id FROM admissions WHERE admissions.hadm_id IN (SELECT diagnoses_icd.hadm_id FROM diagnoses_icd WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'hy kid nos w cr kid i-iv') AND DATETIME(diagnoses_icd.charttime) <= DATETI... |
What is the fame number when the Montreal Canadiens were the opponent? | CREATE TABLE table_name_56 (game VARCHAR,opponent VARCHAR) | SELECT COUNT(game) FROM table_name_56 WHERE opponent = "montreal canadiens" |
What was the score of the away team in the match at Princes Park? | CREATE TABLE table_name_59 (away_team VARCHAR,venue VARCHAR) | SELECT away_team AS score FROM table_name_59 WHERE venue = "princes park" |
During the last semester in MODGREEK 302 , who were the GSIs ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varch... | SELECT DISTINCT student.firstname, student.lastname FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN gsi ON gsi.course_offering_id = course_offering.offering_id INNER JOIN student ON student.student_id = gsi.student_id INNER JOIN semester ON semester.semester_id = course... |
Percent DND questions by month. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class number,TagBased boolean)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score num... | SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS Mnth, (SUM(CASE WHEN Tags LIKE '%dnd%' OR Tags LIKE '%dungeons-and-dragons%' OR Tags LIKE '%pathfinder%' THEN 1 ELSE 0 END) * 100.00) / COUNT(*) AS PercentDND FROM Posts WHERE PostTypeId = 1 GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) ORDER ... |
Show all date and share count of transactions. | CREATE TABLE investors (investor_id number,investor_details text)CREATE TABLE purchases (purchase_transaction_id number,purchase_details text)CREATE TABLE transactions (transaction_id number,investor_id number,transaction_type_code text,date_of_transaction time,amount_of_transaction number,share_count text,other_detail... | SELECT date_of_transaction, share_count FROM transactions |
Name the average year for janaprakal chandruang | CREATE TABLE table_67644 ("Year" real,"Literature" text,"Music" text,"Film" text,"Performing arts" text) | SELECT AVG("Year") FROM table_67644 WHERE "Performing arts" = 'janaprakal chandruang' |
whats the price for a creatinine clearance? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE d_labitems (row_id number,itemid number,label text)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 ... | 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 = 'creatinine clearance')) |
What's the name when Henrik Sundstr m was champion? | CREATE TABLE table_name_88 (name VARCHAR,champion VARCHAR) | SELECT name FROM table_name_88 WHERE champion = "henrik sundström" |
return me the number of papers in PVLDB containing keyword ' Keyword search ' . | CREATE TABLE writes (aid int,pid int)CREATE TABLE organization (continent varchar,homepage varchar,name varchar,oid int)CREATE TABLE author (aid int,homepage varchar,name varchar,oid int)CREATE TABLE domain_journal (did int,jid int)CREATE TABLE publication_keyword (kid int,pid int)CREATE TABLE journal (homepage varchar... | SELECT COUNT(DISTINCT (publication.title)) FROM journal, keyword, publication, publication_keyword WHERE journal.name = 'PVLDB' AND keyword.keyword = 'Keyword search' AND publication_keyword.kid = keyword.kid AND publication.jid = journal.jid AND publication.pid = publication_keyword.pid |
Compute the average price of all products with manufacturer code equal to 2. | CREATE TABLE products (price INTEGER,Manufacturer VARCHAR) | SELECT AVG(price) FROM products WHERE Manufacturer = 2 |
Who was the player from the United States with a score of 70-70-71=211? | CREATE TABLE table_name_66 (player VARCHAR,country VARCHAR,score VARCHAR) | SELECT player FROM table_name_66 WHERE country = "united states" AND score = 70 - 70 - 71 = 211 |
Which programs have ASTRO 160 as a prerequisite ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comm... | SELECT DISTINCT program.name FROM course INNER JOIN program_course ON program_course.course_id = course.course_id INNER JOIN program ON program.program_id = program_course.program_id WHERE course.department = 'ASTRO' AND course.number = 160 |
I want to know the proportion of team id for each all neutral. | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Neutral, Team_ID FROM basketball_match |
What is SECOND, when FIRST is Western Australia? | CREATE TABLE table_name_64 (second VARCHAR,first VARCHAR) | SELECT second FROM table_name_64 WHERE first = "western australia" |
i wish to fly from BOSTON to WASHINGTON please find an airline for me | CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE flight_stop (flight_id int,stop_number int,stop_days... | SELECT DISTINCT airline.airline_code FROM airline, airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BOSTON' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_na... |
what is discharge location of subject name paul edwards? | 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 demographic.discharge_location FROM demographic WHERE demographic.name = "Paul Edwards" |
What is the latest year listed with the Alabama 4 voting district? | CREATE TABLE table_18471 ("District" text,"Incumbent" text,"Party" text,"First elected" real,"Result" text,"Candidates" text) | SELECT MAX("First elected") FROM table_18471 WHERE "District" = 'Alabama 4' |
Give me the comparison about ACC_Percent over the Team_Name . | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT Team_Name, ACC_Percent FROM basketball_match |
What is the Record in a week later than 7 against the San Diego Chargers? | CREATE TABLE table_12453 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game site" text,"Record" text,"Attendance" real) | SELECT "Record" FROM table_12453 WHERE "Week" > '7' AND "Opponent" = 'san diego chargers' |
what is diagnoses long title of subject id 74463? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text... | SELECT diagnoses.long_title FROM diagnoses WHERE diagnoses.subject_id = "74463" |
What number of PHIL 427 prerequisites have I fulfilled ? | CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE gsi (course_offering_id int,student_id int)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_... | SELECT COUNT(DISTINCT COURSE_1.department, COURSE_0.number) FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite, student_record WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'PHIL' AND COURSE_1.number = 427 AND ... |
Which player placed in t5 and had a score of 72-71-73-78=294? | CREATE TABLE table_name_17 (player VARCHAR,place VARCHAR,score VARCHAR) | SELECT player FROM table_name_17 WHERE place = "t5" AND score = 72 - 71 - 73 - 78 = 294 |
count the number of patients whose diagnoses short title is poisoning-opiates nec and drug type is main? | 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 INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Poisoning-opiates NEC" AND prescriptions.drug_type = "MAIN" |
Where did Essendon play as the home team? | CREATE TABLE table_33329 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_33329 WHERE "Home team" = 'essendon' |
What was the record on April 6? | CREATE TABLE table_38646 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Record" FROM table_38646 WHERE "Date" = 'april 6' |
Who had the high points when the score was w 108 105 (ot)? | CREATE TABLE table_46966 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text) | SELECT "High points" FROM table_46966 WHERE "Score" = 'w 108–105 (ot)' |
What is the grid of driver tomas scheckter from vision racing team? | CREATE TABLE table_name_22 (grid VARCHAR,team VARCHAR,driver VARCHAR) | SELECT grid FROM table_name_22 WHERE team = "vision racing" AND driver = "tomas scheckter" |
What is the other value associated with a Christianity value of 10.24%? | CREATE TABLE table_45943 ("Ethnicity" text,"Islam" text,"Christianity" text,"Judaism" text,"Buddhism" text,"Other" text,"Atheism" text) | SELECT "Other" FROM table_45943 WHERE "Christianity" = '10.24%' |
What is the total number of olives of the governorate with less than 259,743 vegetables, more than 14,625 industrial crops, and 20,768 fruit trees? | CREATE TABLE table_12848 ("Governorate" text,"Cereals" real,"Fruit Trees" real,"Olives" real,"Industrial crops" real,"Vegetables" real) | SELECT COUNT("Olives") FROM table_12848 WHERE "Vegetables" < '259,743' AND "Industrial crops" > '14,625' AND "Fruit Trees" = '20,768' |
What state is 25% Democrats has a ratio of 6/2 of Republicans to Democrats? | CREATE TABLE table_67118 ("State ranked in partisan order" text,"Percentage Republicans" text,"Percentage Democrats" text,"Republican/ Democratic" text,"Republican seat plurality" text) | SELECT "State ranked in partisan order" FROM table_67118 WHERE "Percentage Democrats" = '25%' AND "Republican/ Democratic" = '6/2' |
i want a flight from HOUSTON to MEMPHIS on tuesday morning | CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE class_of_service... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, date_day, days, flight WHERE (((flight.departure_time BETWEEN 0 AND 1200) AND date_day.day_number = 22 AND date_day.month_number = 3 AND date_day.year = 1991 AND days.day_nam... |
What is the smallest number of 'goals for' out of the clubs where there were 18 wins and fewer than 38 'goals against'? | CREATE TABLE table_name_85 (goals_for INTEGER,wins VARCHAR,goals_against VARCHAR) | SELECT MIN(goals_for) FROM table_name_85 WHERE wins = 18 AND goals_against < 38 |
Which round did the bout against Jonatas Novaes end in? | CREATE TABLE table_68411 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" real,"Time" text,"Location" text) | SELECT "Round" FROM table_68411 WHERE "Opponent" = 'jonatas novaes' |
The HJCS 425 class how long has it been offered ? | CREATE TABLE program_course (program_id int,course_id int,workload int,category varchar)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... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'HJCS' AND course.number = 425 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
of the third division , how many were in section3 ? | CREATE TABLE table_204_974 (id number,"season" number,"level" text,"division" text,"section" text,"administration" text,"position" text,"movements" text) | SELECT COUNT(*) FROM table_204_974 WHERE "division" = 'third division' AND "section" = 'section 3' |
What date did they play in Cleveland Municipal Stadium? | CREATE TABLE table_14423274_3 (date VARCHAR,game_site VARCHAR) | SELECT date FROM table_14423274_3 WHERE game_site = "Cleveland Municipal Stadium" |
Where is Terre Haute North located? | CREATE TABLE table_name_35 (location VARCHAR,school VARCHAR) | SELECT location FROM table_name_35 WHERE school = "terre haute north" |
Which Tournament has A in 1987? | CREATE TABLE table_name_11 (tournament VARCHAR) | SELECT tournament FROM table_name_11 WHERE 1987 = "a" |
What are the special topics classes available next Winter ? | CREATE TABLE jobs (job_id int,job_title varchar,description varchar,requirement varchar,city varchar,state varchar,country varchar,zip int)CREATE TABLE program (program_id int,name varchar,college varchar,introduction varchar)CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE ... | SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN semester ON semester.semester_id = course_offering.semester WHERE (course.number = 398 OR course.number = 498 OR course.number = 598) AND course.department = 'E... |
What is the points against for the team that played 22 and lost 6? | CREATE TABLE table_name_81 (points_against VARCHAR,played VARCHAR,lost VARCHAR) | SELECT points_against FROM table_name_81 WHERE played = "22" AND lost = "6" |
Give me the comparison about All_Games_Percent over the All_Neutral , could you list y axis in descending order? | CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,Enrollment real,Nickname text,Primary_conference text)CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Perce... | SELECT All_Neutral, All_Games_Percent FROM basketball_match ORDER BY All_Games_Percent DESC |
what is the minimum total cost to the hospital that includes a cortisol lab test? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean num... | SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) GROUP BY cost.patienthealthsystemstayid) AS t1 |
What is the smallest positioned with more than 9 played? | CREATE TABLE table_5248 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT MIN("Position") FROM table_5248 WHERE "Played" > '9' |
Which label has a catalog of y8hr 1006 in 1972? | CREATE TABLE table_name_91 (label VARCHAR,catalog VARCHAR,date VARCHAR) | SELECT label FROM table_name_91 WHERE catalog = "y8hr 1006" AND date = "1972" |
tell me the maximum hospital cost that includes cholecystectomy in 2105? | 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 d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE microbiologyevents (row_id number,subject_id number,had... | SELECT MAX(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'cholecystectomy')) AND STRFTIME('%y', cost.chargetime) = ... |
What is the score of Tim Herron, who placed t1? | CREATE TABLE table_67161 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" text) | SELECT "Score" FROM table_67161 WHERE "Place" = 't1' AND "Player" = 'tim herron' |
With a Grid less than 15, and a Time of +52.833, what is the highest number of Laps? | CREATE TABLE table_48052 ("Rider" text,"Manufacturer" text,"Laps" real,"Time" text,"Grid" real) | SELECT MAX("Laps") FROM table_48052 WHERE "Grid" < '15' AND "Time" = '+52.833' |
Name the party for new york 4 | CREATE TABLE table_19753079_35 (party VARCHAR,district VARCHAR) | SELECT party FROM table_19753079_35 WHERE district = "New York 4" |
show me flights from BALTIMORE to BOSTON | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE code_description (code varchar,description text)CREATE TABLE fli... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, flight WHERE CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'BALTIMORE' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'BOST... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.