instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Top SO in South Carolina. | CREATE TABLE ReviewTaskResultTypes (Id number,Name text,Description text)CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CR... | SELECT Id AS "user_link", Reputation, Location FROM Users WHERE LOWER(Location) LIKE '%charleston, sc%' OR LOWER(Location) LIKE '%south carolina%' ORDER BY Reputation DESC |
Name the league for 2003 | CREATE TABLE table_2511876_1 (league VARCHAR,year VARCHAR) | SELECT league FROM table_2511876_1 WHERE year = 2003 |
What is the highest 2003 value with a 2011 less than 107 and a 1995 value less than 17? | CREATE TABLE table_name_19 (Id VARCHAR) | SELECT MAX(2003) FROM table_name_19 WHERE 2011 < 107 AND 1995 < 17 |
Give me a histogram for how many students are older than 20 in each dorm?, and rank by the Y in ascending please. | CREATE TABLE Has_amenity (dormid INTEGER,amenid INTEGER)CREATE TABLE Lives_in (stuid INTEGER,dormid INTEGER,room_number INTEGER)CREATE TABLE Dorm (dormid INTEGER,dorm_name VARCHAR(20),student_capacity INTEGER,gender VARCHAR(1))CREATE TABLE Dorm_amenity (amenid INTEGER,amenity_name VARCHAR(25))CREATE TABLE Student (StuI... | SELECT dorm_name, COUNT(*) FROM Student AS T1 JOIN Lives_in AS T2 ON T1.stuid = T2.stuid JOIN Dorm AS T3 ON T3.dormid = T2.dormid WHERE T1.Age > 20 GROUP BY T3.dorm_name ORDER BY COUNT(*) |
For those employees who do not work in departments with managers that have ids between 100 and 200, draw a bar chart about the distribution of email and commission_pct , sort X-axis in asc order. | 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 countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME... | SELECT EMAIL, COMMISSION_PCT FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY EMAIL |
What is the total number of wins for Darley of Ballarat FL against larger than 1055? | CREATE TABLE table_41217 ("Ballarat FL" text,"Wins" real,"Byes" real,"Losses" real,"Draws" real,"Against" real) | SELECT COUNT("Wins") FROM table_41217 WHERE "Ballarat FL" = 'darley' AND "Against" > '1055' |
what is the number of elective hospital admission patients who have lab test item id 50927? | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.itemid = "50927" |
What is the number of top-25s in events under 13, cuts made under 3, and 1 top-10? | CREATE TABLE table_42227 ("Tournament" text,"Wins" real,"Top-10" real,"Top-25" real,"Events" real,"Cuts made" real) | SELECT "Top-25" FROM table_42227 WHERE "Events" < '13' AND "Cuts made" < '3' AND "Top-10" = '1' |
Which 400 / 500 -level PERIODON courses have the least workload ? | CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE semester (semester_id int,semester varchar,year int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE program_requirement (program_id int,category varchar,min_credit int,additional_req varchar)CREATE TABLE course_ta... | SELECT DISTINCT course.department, course.name, course.number, program_course.workload FROM course INNER JOIN program_course WHERE ((course.number < 400 + 100 AND course.number >= 400) OR (course.number < 500 + 100 AND course.number >= 500)) AND course.department = 'PERIODON' AND program_course.workload = (SELECT MIN(P... |
Who is the player from round 13 that plays center? | CREATE TABLE table_name_47 (player VARCHAR,round VARCHAR,position VARCHAR) | SELECT player FROM table_name_47 WHERE round = 13 AND position = "center" |
What was the record when the visitor was Cleveland in Dallas? | CREATE TABLE table_name_59 (record VARCHAR,visitor VARCHAR,home VARCHAR) | SELECT record FROM table_name_59 WHERE visitor = "cleveland" AND home = "dallas" |
which type has the lowest max speed ? | CREATE TABLE table_203_154 (id number,"type" text,"manufacturer" text,"numbers" text,"year built" number,"quantity built" number,"power (horsepower)" number,"max speed (km/h)" number,"note" text) | SELECT "type" FROM table_203_154 ORDER BY "max speed (km/h)" LIMIT 1 |
What is the Format and Special Notes for of the pact: ...of the gods? | CREATE TABLE table_53218 ("Year" real,"Tracks" text,"Title" text,"Format,Special Notes" text,"Label" text) | SELECT "Format, Special Notes" FROM table_53218 WHERE "Title" = 'the pact: ...of the gods' |
During the Winter , which PERSIAN classes , upper level , are offered ? | CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE instructor (instructor_id int,name varchar,uniqname varchar)CREATE TABLE course_offering (offering_id int,course_id int,semester in... | SELECT DISTINCT course.department, course.name, course.number FROM course, course_offering, program_course, semester WHERE course.course_id = course_offering.course_id AND course.department = 'PERSIAN' AND program_course.category LIKE '%ULCS%' AND program_course.course_id = course.course_id AND semester.semester = 'Win... |
What are the conditions of access where access using a Croatian identity card is yes and the length of stay permitted is freedom of movement? | CREATE TABLE table_25965003_3 (conditions_of_access VARCHAR,access_using_a_croatian_identity_card VARCHAR,length_of_stay_permitted VARCHAR) | SELECT conditions_of_access FROM table_25965003_3 WHERE access_using_a_croatian_identity_card = "Yes" AND length_of_stay_permitted = "Freedom of movement" |
i need a flight on AC from TORONTO to SAN DIEGO with a layover in WASHINGTON | CREATE TABLE flight_leg (flight_id int,leg_number int,leg_flight int)CREATE TABLE restriction (restriction_code text,advance_purchase int,stopovers text,saturday_stay_required text,minimum_stay int,maximum_stay int,application text,no_discounts text)CREATE TABLE city (city_code varchar,city_name varchar,state_code varc... | SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, city AS CITY_0, city AS CITY_1, city AS CITY_2, flight, flight_stop WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'SAN DIEGO' AND CITY_2... |
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, a bar chart shows the distribution of hire_date and the sum of department_id bin hire_date by weekday, and list by the Y-axis in descending. | 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 HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40 ORDER BY SUM(DEPARTMENT_ID) DESC |
how many patients aged below 70 years had a drug route ivpca? | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "70" AND prescriptions.route = "IVPCA" |
Suggested Edit Review Stats (your approval rate). | CREATE TABLE ReviewTaskStates (Id number,Name text,Description text)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 CloseAsOffTopicReasonTypes (Id number,IsUniversal... | SELECT total, approved, rejected, ROUND(CAST(approved * 100 AS FLOAT) / total, 1) AS ApprovedPercentage, ROUND(CAST(rejected * 100 AS FLOAT) / total, 1) AS RejectedPercentage FROM (SELECT COUNT(Id) AS total, COUNT(ApprovalDate) AS approved, COUNT(RejectionDate) AS rejected FROM SuggestedEdits WHERE OwnerUserId = @UserI... |
Users with Post Tags Sorted by Reputation (without links to Posts). | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREA... | SELECT DISTINCT u.Id AS "user_link", CONCAT('https://stackoverflow.com/users/', u.Id) AS "profile_link", u.DisplayName, u.Location, u.WebsiteUrl, u.AboutMe, u.Views, u.UpVotes, u.DownVotes, u.EmailHash, u.Reputation FROM Users AS u, Posts AS p, Tags AS t, PostTags AS pt WHERE (u.Id = p.OwnerUserId) AND (pt.PostId = p.I... |
How many questions have these tags?. | CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescr... | SELECT SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' THEN 1 ELSE 0 END) AS accessTag, SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' AND NOT p.Tags LIKE '%<ms-access>%' THEN 1 ELSE 0 END) AS accessWOms, SUM(CASE WHEN p.Tags LIKE '%<access-vba>%' AND NOT p.Tags LIKE '%<vba>%' THEN 1 ELSE 0 END) AS accessWOvba, SUM(CASE WHEN p.... |
getting all TagSynonyms mapped to Tags. | CREATE TABLE PostNoticeTypes (Id number,ClassId number,Name text,Body text,IsHidden boolean,Predefined boolean,PostNoticeDurationId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId numbe... | SELECT DISTINCT t1.TagName FROM Tags AS t1, TagSynonyms AS t2 WHERE t1.TagName = t2.TargetTagName ORDER BY t1.TagName |
How many instruments does the song 'Le Pop' use? | CREATE TABLE tracklists (albumid number,position number,songid number)CREATE TABLE instruments (songid number,bandmateid number,instrument text)CREATE TABLE band (id number,firstname text,lastname text)CREATE TABLE songs (songid number,title text)CREATE TABLE albums (aid number,title text,year number,label text,type te... | SELECT COUNT(DISTINCT instrument) FROM instruments AS T1 JOIN songs AS T2 ON T1.songid = T2.songid WHERE title = "Le Pop" |
count the number of patients whose primary disease is aortic valve insufficiency/aortic valve replacement/sda and lab test fluid is blood. | CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,la... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "AORTIC VALVE INSUFFIENCY\AORTIC VALVE REPLACEMENT /SDA" AND lab.fluid = "Blood" |
Tell me the format with year more than 2000 and label of myuzyk with catalog number of mzykn08 | CREATE TABLE table_10499 ("Title" text,"Format" text,"Label" text,"Catalog number" text,"Formats" text,"Year" real) | SELECT "Format" FROM table_10499 WHERE "Year" > '2000' AND "Label" = 'myuzyk' AND "Catalog number" = 'mzykn08' |
For each airport name, how many routes start at that airport? | CREATE TABLE routes (rid number,dst_apid number,dst_ap text,src_apid number,src_ap text,alid number,airline text,codeshare text)CREATE TABLE airports (apid number,name text,city text,country text,x number,y number,elevation number,iata text,icao text)CREATE TABLE airlines (alid number,name text,iata text,icao text,call... | SELECT COUNT(*), T1.name FROM airports AS T1 JOIN routes AS T2 ON T1.apid = T2.src_apid GROUP BY T1.name |
What is the name of the Venue for the team that has an Away team score of 14.11 (95)? | CREATE TABLE table_78149 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Venue" FROM table_78149 WHERE "Away team score" = '14.11 (95)' |
did brazil score more goals against the soviet union or portugal in 1982 ? | CREATE TABLE table_204_814 (id number,"date" text,"opposition" text,"result" text,"score" text,"brazil scorers" text,"competition" text) | SELECT "opposition" FROM table_204_814 WHERE "opposition" IN ('soviet union', 'portugal') ORDER BY "score" DESC LIMIT 1 |
on monday show me flights from BALTIMORE to DALLAS | 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_fare (flight_id int,fare_id int)CREATE TABLE aircraft (aircraft_code varchar,aircraft_description varchar,manufacturer varchar,ba... | 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 (CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'DALLAS' AND date_day.day_number = 21 AND date_day.month_number = 2 AND da... |
Which Opponent has a January larger than 8, and a Game smaller than 48, and a Score of 5 3? | CREATE TABLE table_35992 ("Game" real,"January" real,"Opponent" text,"Score" text,"Record" text,"Points" real) | SELECT "Opponent" FROM table_35992 WHERE "January" > '8' AND "Game" < '48' AND "Score" = '5–3' |
What is the lowest Mintage for the Artist Royal Canadian Mint Engravers, in the Year 2009, with an Issue Price of $10,199.95? | CREATE TABLE table_54943 ("Year" real,"Artist" text,"Composition" text,"Mintage" real,"Issue Price" text) | SELECT MIN("Mintage") FROM table_54943 WHERE "Artist" = 'royal canadian mint engravers' AND "Issue Price" = '$10,199.95' AND "Year" > '2009' |
which town would come first in alphabetical order , of all the towns in the faroe islands ? | CREATE TABLE table_203_568 (id number,"town/village" text,"population" number,"postal code" text,"municipality" text,"island" text,"location" text) | SELECT "town/village" FROM table_203_568 ORDER BY "town/village" LIMIT 1 |
What is the average attendance of the match with arlesey town as the home team? | CREATE TABLE table_49565 ("Tie no" real,"Home team" text,"Score" text,"Away team" text,"Attendance" real) | SELECT AVG("Attendance") FROM table_49565 WHERE "Home team" = 'arlesey town' |
Which Attendance has a First Downs smaller than 26, an Opponent of los angeles rams, and Points For larger than 28? | CREATE TABLE table_name_98 (attendance INTEGER,points_for VARCHAR,first_downs VARCHAR,opponent VARCHAR) | SELECT SUM(attendance) FROM table_name_98 WHERE first_downs < 26 AND opponent = "los angeles rams" AND points_for > 28 |
what is the total numbers of medals won by ecuador ? | CREATE TABLE table_204_771 (id number,"rank" number,"nation" text,"gold" number,"silver" number,"bronze" number,"total" number) | SELECT "total" FROM table_204_771 WHERE "nation" = 'ecuador' |
what is the series when the team is gunbroker racing? | CREATE TABLE table_name_95 (series VARCHAR,team VARCHAR) | SELECT series FROM table_name_95 WHERE team = "gunbroker racing" |
What is the network that plays ugly betty? | CREATE TABLE table_55615 ("Network" text,"8:00 PM" text,"8:30 PM" text,"9:00 PM" text,"9:30 PM" text,"10:00 PM" text) | SELECT "Network" FROM table_55615 WHERE "8:30 PM" = 'ugly betty' |
What college/junior/club teams do the players from the St. Louis Blues come from? | CREATE TABLE table_1013129_11 (college_junior_club_team VARCHAR,nhl_team VARCHAR) | SELECT college_junior_club_team FROM table_1013129_11 WHERE nhl_team = "St. Louis Blues" |
What is the name of chapter 8 of season 4? | CREATE TABLE table_28685 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real,"U.S. viewers (million)" text) | SELECT "Title" FROM table_28685 WHERE "No. in season" = '8' |
How many living patients were diagnosed with procedure icd9 code 3897? | CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime tex... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.expire_flag = "0" AND procedures.icd9_code = "3897" |
What is the average Events when the top-25 is 12 and there are less than 0 wins? | CREATE TABLE table_name_62 (events INTEGER,top_25 VARCHAR,wins VARCHAR) | SELECT AVG(events) FROM table_name_62 WHERE top_25 = 12 AND wins < 0 |
What is the population of area of 11? | CREATE TABLE table_60875 ("English Name" text,"Simplified" text,"Traditional" text,"Pinyin" text,"Area" text,"Population" text,"Density" text) | SELECT "Population" FROM table_60875 WHERE "Area" = '11' |
Which Score has a Date of july 20? | CREATE TABLE table_name_2 (score VARCHAR,date VARCHAR) | SELECT score FROM table_name_2 WHERE date = "july 20" |
Display a bar chart for what are the numbers of wines for different grapes? | CREATE TABLE grapes (ID INTEGER,Grape TEXT,Color TEXT)CREATE TABLE wine (No INTEGER,Grape TEXT,Winery TEXT,Appelation TEXT,State TEXT,Name TEXT,Year INTEGER,Price INTEGER,Score INTEGER,Cases INTEGER,Drink TEXT)CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA TEXT) | SELECT Grape, COUNT(*) FROM wine GROUP BY Grape |
Pundit comments, with scores, sorted DESC. | CREATE TABLE PostNotices (Id number,PostId number,PostNoticeTypeId number,CreationDate time,DeletionDate time,ExpiryDate time,Body text,OwnerUserId number,DeletionUserId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE SuggestedEdits (Id number,PostId number,CreationDate time,ApprovalDate time,Rej... | SELECT Id AS "comment_link", Score FROM Comments WHERE UserId = '##UserId##' AND Score > 0 ORDER BY Score DESC |
What is the score when Miami is the visitor? | CREATE TABLE table_name_33 (score VARCHAR,visitor VARCHAR) | SELECT score FROM table_name_33 WHERE visitor = "miami" |
provide the number of patients whose year of birth is less than 2156 and drug name is levetiracetam? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.dob_year < "2156" AND prescriptions.drug = "Levetiracetam" |
What is the sum of the wards/branches in Arkansas of the North Little Rock Arkansas stake? | CREATE TABLE table_name_93 (wards__branches_in_arkansas INTEGER,stake VARCHAR) | SELECT SUM(wards__branches_in_arkansas) FROM table_name_93 WHERE stake = "north little rock arkansas" |
Name the score when it had a decision of dipietro and visitor of ny islanders with home of colorado | CREATE TABLE table_name_80 (score VARCHAR,home VARCHAR,decision VARCHAR,visitor VARCHAR) | SELECT score FROM table_name_80 WHERE decision = "dipietro" AND visitor = "ny islanders" AND home = "colorado" |
Get High-Scoring Comments and associated posts, by User ID. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class numbe... | SELECT * FROM Comments JOIN Posts ON Comments.PostId = Posts.Id JOIN PostLinks ON Posts.Id = PostLinks.PostId WHERE UserId = @UserID AND Comments.Score >= 0 ORDER BY Comments.Score DESC |
Name the drivetrain for 1ur-fse for usf41 | CREATE TABLE table_21530474_1 (drivetrain VARCHAR,engine_code VARCHAR,chassis_code VARCHAR) | SELECT drivetrain FROM table_21530474_1 WHERE engine_code = "1UR-FSE" AND chassis_code = "USF41" |
What is the name of the minister from the party of minister for community safety and legal affairs? | CREATE TABLE table_name_45 (name VARCHAR,party VARCHAR) | SELECT name FROM table_name_45 WHERE party = "minister for community safety and legal affairs" |
What season had a combined of 13 and a Giant Slalom more than 31? | CREATE TABLE table_43740 ("Season" real,"Overall" real,"Slalom" text,"Giant Slalom" real,"Super G" text,"Downhill" text,"Combined" text) | SELECT MAX("Season") FROM table_43740 WHERE "Combined" = '13' AND "Giant Slalom" > '31' |
What week did the dallas cowboys play? | CREATE TABLE table_name_78 (week INTEGER,opponent VARCHAR) | SELECT SUM(week) FROM table_name_78 WHERE opponent = "dallas cowboys" |
What is the railway number of the aw class? | CREATE TABLE table_64262 ("Class" text,"Railway number(s)" text,"Quantity" text,"Year(s) of manufacture" text,"Type" text) | SELECT "Railway number(s)" FROM table_64262 WHERE "Class" = 'aw' |
What is the fewest amendments sponsored associated with 150 bills originally cosponsored and over 247 bills cosponsored? | CREATE TABLE table_name_52 (all_amendments_sponsored INTEGER,bills_originally_cosponsored VARCHAR,all_bills_cosponsored VARCHAR) | SELECT MIN(all_amendments_sponsored) FROM table_name_52 WHERE bills_originally_cosponsored = 150 AND all_bills_cosponsored > 247 |
What year was the player David Rose? | CREATE TABLE table_name_97 (year INTEGER,player VARCHAR) | SELECT SUM(year) FROM table_name_97 WHERE player = "david rose" |
for patient id 64208, specify the time of admission and icd9 code. | 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 demographic.admittime, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.subject_id = "64208" |
how much does patient 19428 change in temperature c (calc) last measured on the current icu visit compared to the first value measured on the current icu visit? | CREATE TABLE inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)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 transfers (row_id nu... | 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 = 19428) AND icustays.outtime IS NULL) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_i... |
What was the date of Circuit Hockenheimring and the winning manufacturer being Mercedes-Benz? | CREATE TABLE table_name_34 (date VARCHAR,circuit VARCHAR,winning_manufacturer VARCHAR) | SELECT date FROM table_name_34 WHERE circuit = "hockenheimring" AND winning_manufacturer = "mercedes-benz" |
What is the order for a red list of 7 in the didelphidae family? | CREATE TABLE table_14746 ("Name" text,"Species Authority" text,"Order" text,"Family" text,"Red List" real) | SELECT "Order" FROM table_14746 WHERE "Red List" = '7' AND "Family" = 'didelphidae' |
Was it a home game on the date of April 6? | CREATE TABLE table_53909 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text) | SELECT "Home" FROM table_53909 WHERE "Date" = 'april 6' |
How many people on average attend round f? | CREATE TABLE table_48496 ("Date" text,"Round" text,"Opponent" text,"Venue" text,"Result" text,"Attendance" real) | SELECT AVG("Attendance") FROM table_48496 WHERE "Round" = 'f' |
How many Drawn have an Against smaller than 5, and a Played smaller than 3? | CREATE TABLE table_5105 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text) | SELECT COUNT("Drawn") FROM table_5105 WHERE "Against" < '5' AND "Played" < '3' |
Show the most common location of performances. | CREATE TABLE member (member_id text,name text,nationality text,role text)CREATE TABLE performance (performance_id number,date text,host text,location text,attendance number)CREATE TABLE member_attendance (member_id number,performance_id number,num_of_pieces number) | SELECT location FROM performance GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1 |
what was the last opponent played in 1950 ? | CREATE TABLE table_203_590 (id number,"date" text,"venue" text,"opponents" text,"score" text,"competition" text,"scotland scorer(s)" text) | SELECT "opponents" FROM table_203_590 WHERE "date" = 1950 ORDER BY "date" DESC LIMIT 1 |
What are all the production codes of episodes written by Michael G. Moye? | CREATE TABLE table_24879 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text) | SELECT "Production code" FROM table_24879 WHERE "Written by" = 'Michael G. Moye' |
How many lessons did the customer Ryan Goodwin complete? | CREATE TABLE customers (customer_id number,customer_address_id number,customer_status_code text,date_became_customer time,date_of_birth time,first_name text,last_name text,amount_outstanding number,email_address text,phone_number text,cell_mobile_phone_number text)CREATE TABLE lessons (lesson_id number,customer_id numb... | SELECT COUNT(*) FROM lessons AS T1 JOIN customers AS T2 ON T1.customer_id = T2.customer_id WHERE T2.first_name = "Rylan" AND T2.last_name = "Goodwin" AND T1.lesson_status_code = "Completed" |
top 100 users from japan. | CREATE TABLE PostHistoryTypes (Id number,Name text)CREATE TABLE Votes (Id number,PostId number,VoteTypeId number,UserId number,CreationDate time,BountyAmount number)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCou... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%japan%' OR UPPER(Location) LIKE '%JP' OR UPPER(Location) LIKE '%JPN' ORDER BY Reputation DESC LIMIT 100 |
Who was the leader at the summit for the race in 2005? | CREATE TABLE table_52966 ("Year" real,"Stage" real,"Category" text,"Start" text,"Finish" text,"Leader at the summit" text) | SELECT "Leader at the summit" FROM table_52966 WHERE "Year" = '2005' |
Who has 1 win, 1 loss, and has played 2 matches? | CREATE TABLE table_71370 ("Name" text,"Period" text,"Matches" text,"Wins" text,"Draws" text,"Losses" text) | SELECT "Name" FROM table_71370 WHERE "Wins" = '1' AND "Losses" = '1' AND "Matches" = '2' |
give the number of patients whose admission location is phys referral/normal deli and lab test name is lactate dehydrogenase, pleural. | 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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND lab.label = "Lactate Dehydrogenase, Pleural" |
What is the state code of VA? | CREATE TABLE ndecoreexcel_math_grade8 (year number,state text,all_students text,average_scale_score number)CREATE TABLE finrev_fed_17 (state_code number,idcensus number,school_district text,nces_id text,yr_data number,t_fed_rev number,c14 number,c25 number)CREATE TABLE finrev_fed_key_17 (state_code number,state text,#_... | SELECT state_code FROM finrev_fed_key_17 WHERE state = "Virginia" |
What is the highest number of viewers for a rating greater than 9.4? | CREATE TABLE table_name_47 (viewers__m_ INTEGER,rating INTEGER) | SELECT MAX(viewers__m_) FROM table_name_47 WHERE rating > 9.4 |
Which group has a registration less than 75 in 2011, more then 140 in 2005, and less than 148 in 2002? | CREATE TABLE table_54071 ("Breed [A ]" text,"Group" text,"2002 Registrations" real,"2005 Registrations" real,"2011 Registrations" real) | SELECT "Group" FROM table_54071 WHERE "2011 Registrations" > '75' AND "2005 Registrations" > '140' AND "2002 Registrations" < '148' |
Who was the rookie who played when Matt Vinc was defensive and Pat Maddalena was offensive? | CREATE TABLE table_name_6 (rookie VARCHAR,defensive VARCHAR,offensive VARCHAR) | SELECT rookie FROM table_name_6 WHERE defensive = "matt vinc" AND offensive = "pat maddalena" |
How many 'number of seasons in top division' were played if the 'first season in top division' games is in 1990-91? | CREATE TABLE table_1820 ("Club" text,"First season in top division" text,"Number of seasons in top division" real,"First season of current spell in top division" text,"Number of seasons in Liga MX" real,"Top division titles" real) | SELECT MAX("Number of seasons in top division") FROM table_1820 WHERE "First season in top division" = '1990-91' |
Which week had a result of L 38-21? | CREATE TABLE table_63023 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" text) | SELECT "Week" FROM table_63023 WHERE "Result" = 'l 38-21' |
Which team has a Game of 49? | CREATE TABLE table_name_18 (team VARCHAR,game VARCHAR) | SELECT team FROM table_name_18 WHERE game = 49 |
Which Computer Networks courses satisfy the MDE requirement ? | 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 area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Computer Networks%' OR course.description LIKE '%Computer Networks%' OR course.name LIKE '%Compu... |
WHAT IS THE PICK WITH K POSITION AND OVERALL SMALLER THAN 181? | CREATE TABLE table_44219 ("Round" real,"Pick" real,"Overall" real,"Name" text,"Position" text,"College" text) | SELECT SUM("Pick") FROM table_44219 WHERE "Position" = 'k' AND "Overall" < '181' |
how many games were not scheduled for 1:00 pm ? | CREATE TABLE table_203_280 (id number,"week" number,"date" text,"opponent" text,"result" text,"record" text,"game site" text,"tv time" text,"attendance" number,"bye" text) | SELECT COUNT(*) FROM table_203_280 WHERE "tv time" <> 1 |
What was the number of passengers going to MCO with a rank larger than 9? | CREATE TABLE table_name_54 (passengers VARCHAR,airport VARCHAR,rank VARCHAR) | SELECT COUNT(passengers) FROM table_name_54 WHERE airport = "mco" AND rank > 9 |
I want the country for score of 274 and runner-up of virginie lagoutte-cl ment | CREATE TABLE table_name_93 (country VARCHAR,score VARCHAR,runner_s__up VARCHAR) | SELECT country FROM table_name_93 WHERE score = "274" AND runner_s__up = "virginie lagoutte-clément" |
What is every use for number 1? | CREATE TABLE table_1977 ("Number" text,"Previous Number(s)" real,"Previous Class" text,"Converted" real,"Use" text,"Withdrawn" real,"Disposal" text) | SELECT "Use" FROM table_1977 WHERE "Number" = '1' |
How many titles had an average rating of 8.9%? | CREATE TABLE table_73026 ("Japanese Title" text,"Romaji Title" text,"TV Station" text,"Time Frame" text,"Starring Actors" text,"Theme Song(s)" text,"Episodes" real,"Average Ratings" text) | SELECT COUNT("Romaji Title") FROM table_73026 WHERE "Average Ratings" = '8.9%' |
Return the gender and name of artist who produced the song with the lowest resolution. | CREATE TABLE artist (artist_name text,country text,gender text,preferred_genre text)CREATE TABLE genre (g_name text,rating text,most_popular_in text)CREATE TABLE song (song_name text,artist_name text,country text,f_id number,genre_is text,rating number,languages text,releasedate time,resolution number)CREATE TABLE file... | 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 |
List the opposing team from february 22, 1983. | CREATE TABLE table_28616 ("#" real,"Player" text,"Points" real,"Rebounds" real,"Assists" real,"Opponent" text,"Date" text) | SELECT "Opponent" FROM table_28616 WHERE "Date" = 'February 22, 1983' |
Record of 19 16 occurred on what date? | CREATE TABLE table_name_78 (date VARCHAR,record VARCHAR) | SELECT date FROM table_name_78 WHERE record = "19–16" |
Specify the discharge location of patient Dona Cole along with the ICU stay ID | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob... | SELECT demographic.discharge_location, prescriptions.icustay_id FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.name = "Dona Cole" |
What is the time entry for the track composed by ROZ, with the title ' (good luck!!)'? | CREATE TABLE table_60595 ("Title" text,"Lyricist(s)" text,"Composer(s)" text,"Arranger(s)" text,"Time" text) | SELECT "Time" FROM table_60595 WHERE "Composer(s)" = 'roz' AND "Title" = '잘해봐 (good luck!!)' |
The stenhousemuir team had how many highest attendances? | CREATE TABLE table_11206916_1 (highest VARCHAR,team VARCHAR) | SELECT COUNT(highest) FROM table_11206916_1 WHERE team = "Stenhousemuir" |
View your public votes with vote type. | CREATE TABLE Users (Id number,Reputation number,CreationDate time,DisplayName text,LastAccessDate time,WebsiteUrl text,Location text,AboutMe text,Views number,UpVotes number,DownVotes number,ProfileImageUrl text,EmailHash text,AccountId number)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TA... | SELECT v.PostId AS "post_link", vt.Name AS "vote_type" FROM Votes AS v JOIN VoteTypes AS vt ON v.VoteTypeId = vt.Id WHERE UserId = '##UserId##' |
WHAT IS THE NUMBER OF VIEWERS WITH EPISODE LARGER THAN 10, RATING SMALLER THAN 2? | CREATE TABLE table_76681 ("Episode number" real,"Episode" text,"Rating" real,"Share" real,"Rating/Share (18-49)" text,"Viewers (millions)" real,"Rank (Overall)" text) | SELECT MAX("Viewers (millions)") FROM table_76681 WHERE "Episode number" > '10' AND "Rating" < '2' |
Who commented on a given user's answers. | CREATE TABLE TagSynonyms (Id number,SourceTagName text,TargetTagName text,CreationDate time,OwnerUserId number,AutoRenameCount number,LastAutoRename time,Score number,ApprovedByUserId number,ApprovalDate time)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Post... | SELECT u.Id AS "Commenter ID", u.DisplayName AS "Name", u.Reputation AS "Reputation", c.CreationDate AS "Comment Date", q.Id AS "Question ID", q.CreationDate AS "Question Date", q.Title AS "Title" FROM Posts AS a JOIN Posts AS q ON a.ParentId = q.Id JOIN Comments AS c ON c.PostId = a.Id JOIN Users AS u ON u.Id = c.User... |
Where is the University that plays in the American Athletic Conference? | CREATE TABLE table_2005 ("Institution" text,"Location" text,"Founded" real,"Affiliation" text,"Enrollment" real,"Year Joined" real,"Nickname" text,"Conference" text) | SELECT "Location" FROM table_2005 WHERE "Conference" = 'American Athletic Conference' |
Draw a bar chart about the distribution of other_details and the sum of monthly_rental , and group by attribute other_details. | CREATE TABLE Ref_Incident_Type (incident_type_code VARCHAR(10),incident_type_description VARCHAR(80))CREATE TABLE Teachers (teacher_id INTEGER,address_id INTEGER,first_name VARCHAR(80),middle_name VARCHAR(80),last_name VARCHAR(80),gender VARCHAR(1),cell_mobile_number VARCHAR(40),email_address VARCHAR(40),other_details ... | SELECT other_details, SUM(monthly_rental) FROM Student_Addresses GROUP BY other_details ORDER BY monthly_rental DESC |
List the name, origin and owner of each program. | CREATE TABLE broadcast_share (channel_id number,program_id number,date text,share_in_percent number)CREATE TABLE program (program_id number,name text,origin text,launch number,owner text)CREATE TABLE broadcast (channel_id number,program_id number,time_of_day text)CREATE TABLE channel (channel_id number,name text,owner ... | SELECT name, origin, owner FROM program |
How old is the ARTDES 155 course ? | 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 comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE ta (campus_job_id int,student_id ... | SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'ARTDES' AND course.number = 155 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1 |
when last patient 96404 was discharged from the hospital? | CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE d_icd_diagnoses (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE labevents (row_id number... | SELECT admissions.dischtime FROM admissions WHERE admissions.subject_id = 96404 ORDER BY admissions.dischtime DESC LIMIT 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.