instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
Which Game has High assists of s. threatt (9)? | CREATE TABLE table_name_97 (game INTEGER,high_assists VARCHAR) | SELECT MIN(game) FROM table_name_97 WHERE high_assists = "s. threatt (9)" |
Which Country has a To par smaller than 7, and a Place of 1? | CREATE TABLE table_60365 ("Place" text,"Player" text,"Country" text,"Score" text,"To par" real) | SELECT "Country" FROM table_60365 WHERE "To par" < '7' AND "Place" = '1' |
Who wrote episode that had 1.97 million u.s. viewers? | CREATE TABLE table_30063 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" text,"U.S. viewers (million)" text) | SELECT "Written by" FROM table_30063 WHERE "U.S. viewers (million)" = '1.97' |
For those records from the products and each product's manufacturer, give me the comparison about the sum of manufacturer over the name , and group by attribute name by a bar chart, and could you show 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 T2.Name, T1.Manufacturer FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name DESC |
what's the function / genus with shigella being spa32 | CREATE TABLE table_16047 ("\u2193 Function / Genus \u2192" text,"Shigella" text,"Salmonella" text,"Yersinia" text,"Escherichia" text) | SELECT "\u2193 Function / Genus \u2192" FROM table_16047 WHERE "Shigella" = 'Spa32' |
What nation had a moving from of espanyol? | CREATE TABLE table_name_97 (nat VARCHAR,moving_from VARCHAR) | SELECT nat FROM table_name_97 WHERE moving_from = "espanyol" |
Bronze of 0, and a Total of 1, and a Silver smaller than 1 what is the lowest gold? | CREATE TABLE table_name_35 (gold INTEGER,silver VARCHAR,bronze VARCHAR,total VARCHAR) | SELECT MIN(gold) FROM table_name_35 WHERE bronze = 0 AND total = 1 AND silver < 1 |
give me the number of patients whose primary disease is liver transplant and procedure short title is skin & subq dx proc nec? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.diagnosis = "LIVER TRANSPLANT" AND procedures.short_title = "Skin & subq dx proc NEC" |
Which Record has a Loss of o'connor (0-1)? | CREATE TABLE table_34890 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text,"Record" text) | SELECT "Record" FROM table_34890 WHERE "Loss" = 'o''connor (0-1)' |
A pie chart for listing the number of the description of the outcomes for all projects. | CREATE TABLE Staff_Roles (role_code VARCHAR(10),role_description VARCHAR(255))CREATE TABLE Grants (grant_id INTEGER,organisation_id INTEGER,grant_amount DECIMAL(19,4),grant_start_date DATETIME,grant_end_date DATETIME,other_details VARCHAR(255))CREATE TABLE Documents (document_id INTEGER,document_type_code VARCHAR(10),g... | SELECT outcome_description, COUNT(outcome_description) FROM Research_Outcomes AS T1 JOIN Project_Outcomes AS T2 ON T1.outcome_code = T2.outcome_code GROUP BY outcome_description |
Which throw number had a DOB of 19/10/81? | CREATE TABLE table_6136 ("Surname" text,"First" text,"D.O.B." text,"Uni#" real,"Bats" text,"Throws" text,"Position" text) | SELECT "Throws" FROM table_6136 WHERE "D.O.B." = '19/10/81' |
Which party has the largest number of delegates? | CREATE TABLE election (election_id number,counties_represented text,district number,delegate text,party number,first_elected number,committee text)CREATE TABLE county (county_id number,county_name text,population number,zip_code text)CREATE TABLE party (party_id number,year number,party text,governor text,lieutenant_go... | SELECT T2.party FROM election AS T1 JOIN party AS T2 ON T1.party = T2.party_id GROUP BY T1.party ORDER BY COUNT(*) DESC LIMIT 1 |
what is the hospital admission times of patient 16554 since 2105? | CREATE TABLE outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)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_diagnose... | SELECT admissions.admittime FROM admissions WHERE admissions.subject_id = 16554 AND STRFTIME('%y', admissions.admittime) >= '2105' |
Which player has an A-League of 150 (4)? | CREATE TABLE table_name_1 (name VARCHAR,a_league VARCHAR) | SELECT name FROM table_name_1 WHERE a_league = "150 (4)" |
What is the largest area with a Code of 66097, and a Region larger than 6? | CREATE TABLE table_77858 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Metropolitan area" text,"Region" real) | SELECT MAX("Area (km 2 )") FROM table_77858 WHERE "Code" = '66097' AND "Region" > '6' |
How much did the baby who name means God knows my journey weigh at birth? | CREATE TABLE table_78040 ("Full Name" text,"Nickname" text,"Gender" text,"Weight at birth" text,"Meaning" text) | SELECT "Weight at birth" FROM table_78040 WHERE "Meaning" = 'god knows my journey' |
For those dates with a max temperature greater than or equal to 80, I would like a line chart to show the tendency, I want to display by the X-axis in desc. | CREATE TABLE station (id INTEGER,name TEXT,lat NUMERIC,long NUMERIC,dock_count INTEGER,city TEXT,installation_date TEXT)CREATE TABLE trip (id INTEGER,duration INTEGER,start_date TEXT,start_station_name TEXT,start_station_id INTEGER,end_date TEXT,end_station_name TEXT,end_station_id INTEGER,bike_id INTEGER,subscription_... | SELECT date, COUNT(date) FROM weather WHERE max_temperature_f >= 80 GROUP BY date ORDER BY date DESC |
Name the number of players for field goals being 25 and blocks is 6 | CREATE TABLE table_23184448_4 (player VARCHAR,field_goals VARCHAR,blocks VARCHAR) | SELECT COUNT(player) FROM table_23184448_4 WHERE field_goals = 25 AND blocks = 6 |
List the number of companies for each building in a bar chart. | CREATE TABLE Companies (id int,name text,Headquarters text,Industry text,Sales_billion real,Profits_billion real,Assets_billion real,Market_Value_billion text)CREATE TABLE Office_locations (building_id int,company_id int,move_in_year int)CREATE TABLE buildings (id int,name text,City text,Height int,Stories int,Status t... | SELECT T2.name, COUNT(T2.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T2.name |
who is the the voice actor (japanese) with character name being goku | CREATE TABLE table_19134 ("Character Name" text,"Voice Actor (Japanese)" text,"Voice Actor (English 1997 / Saban)" text,"Voice Actor (English 1998 / Pioneer)" text,"Voice Actor (English 2006 / FUNimation)" text) | SELECT "Voice Actor (Japanese)" FROM table_19134 WHERE "Character Name" = 'Goku' |
Visualize a pie chart with what is average age of male for different job title? | CREATE TABLE PersonFriend (name varchar(20),friend varchar(20),year INTEGER)CREATE TABLE Person (name varchar(20),age INTEGER,city TEXT,gender TEXT,job TEXT) | SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job |
how many drivers scored above 150 points ? | CREATE TABLE table_204_853 (id number,"pos" number,"grid" number,"no." number,"driver" text,"team" text,"manufacturer" text,"laps" number,"points" number) | SELECT COUNT("driver") FROM table_204_853 WHERE "points" > 150 |
there was a fifth place tie in 1967 , what was the next year to have a fifth place tie ? | CREATE TABLE table_204_110 (id number,"year" number,"champion" text,"city" text,"llws" text,"record" text) | SELECT MIN("year") FROM table_204_110 WHERE "llws" = 'fifth place (tie)' AND "year" > 1967 |
What is the largest lost stat when the difference is - 19? | CREATE TABLE table_name_36 (lost INTEGER,difference VARCHAR) | SELECT MAX(lost) FROM table_name_36 WHERE difference = "- 19" |
Tell me the time for martin kampmann | CREATE TABLE table_54311 ("Res." text,"Record" text,"Opponent" text,"Method" text,"Round" real,"Time" text,"Location" text) | SELECT "Time" FROM table_54311 WHERE "Opponent" = 'martin kampmann' |
How many wins did they have at Richmond Cricket Ground Stadium? | CREATE TABLE table_name_20 (wins VARCHAR,stadium VARCHAR) | SELECT wins FROM table_name_20 WHERE stadium = "richmond cricket ground" |
Anonymous Feedback - Top Posts. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate tim... | SELECT p.Id AS "post_link", p.Score, SUM(CASE WHEN f.VoteTypeId = 2 THEN 1 ELSE 0 END) AS AnonUpvotes, SUM(CASE WHEN f.VoteTypeId = 3 THEN 1 ELSE 0 END) AS AnonDownvotes, COUNT(f.Id) AS TotalAnonVotes FROM Posts AS p INNER JOIN PostFeedback AS f ON p.Id = f.PostId WHERE p.PostTypeId IN (1, 2) AND p.CreationDate >= '201... |
What issue has mort drucker as the artist and february 2001 as the date? | CREATE TABLE table_name_20 (issue VARCHAR,artist VARCHAR,date VARCHAR) | SELECT issue FROM table_name_20 WHERE artist = "mort drucker" AND date = "february 2001" |
Return the booking end dates for the apartments that have type code 'Duplex' and bin the year into weekday interval with a bar chart. | CREATE TABLE Guests (guest_id INTEGER,gender_code CHAR(1),guest_first_name VARCHAR(80),guest_last_name VARCHAR(80),date_of_birth DATETIME)CREATE TABLE View_Unit_Status (apt_id INTEGER,apt_booking_id INTEGER,status_date DATETIME,available_yn BIT)CREATE TABLE Apartments (apt_id INTEGER,building_id INTEGER,apt_type_code C... | SELECT booking_end_date, COUNT(booking_end_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id WHERE T2.apt_type_code = "Duplex" |
What is the number of bronze medals when there are fewer than 0 silver medals? | CREATE TABLE table_78124 ("Rank" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real) | SELECT SUM("Bronze") FROM table_78124 WHERE "Silver" < '0' |
What was Craig Wood's score? | CREATE TABLE table_name_22 (score VARCHAR,player VARCHAR) | SELECT score FROM table_name_22 WHERE player = "craig wood" |
Visualize a bar chart about the distribution of meter_400 and ID . | CREATE TABLE event (ID int,Name text,Stadium_ID int,Year text)CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)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 ... | SELECT meter_400, ID FROM swimmer |
one way flights from ONTARIO to TACOMA leaving before 1000 on any day and FIRST class | CREATE TABLE city (city_code varchar,city_name varchar,state_code varchar,country_name varchar,time_zone_code varchar)CREATE TABLE days (days_code varchar,day_name varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE dual_carrier (main_airline varchar,low_flight_number int,high_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, fare, fare_basis, flight, flight_fare WHERE (((fare.round_trip_required = 'NO') AND fare_basis.class_type = 'FIRST' AND fare.fare_basis_code = fare_basis.fare_basis_code AND ... |
If the calculated activity (CI) is 4.96 10 11, what is the specimen weight/size? | CREATE TABLE table_26211058_1 (specimen_weight_size VARCHAR,calculated_activity___ci__ VARCHAR) | SELECT specimen_weight_size FROM table_26211058_1 WHERE calculated_activity___ci__ = "4.96×10 −11" |
WHAT IS THE RECORD FOR DATE NOVEMBER 14? | CREATE TABLE table_name_44 (record VARCHAR,date VARCHAR) | SELECT record FROM table_name_44 WHERE date = "november 14" |
Name the replacced by with ascoli | CREATE TABLE table_17275810_7 (replaced_by VARCHAR,team VARCHAR) | SELECT replaced_by FROM table_17275810_7 WHERE team = "Ascoli" |
What was the english translation for the song by svetlana loboda? | CREATE TABLE table_76346 ("Draw" real,"Language" text,"Artist" text,"Song" text,"English translation" text,"Place" real,"Points" real) | SELECT "English translation" FROM table_76346 WHERE "Artist" = 'svetlana loboda' |
Top Users from Algeria all wilaya. | CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate ti... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, WebsiteUrl AS Wesbite, LastAccessDate AS Seen, CreationDate FROM Users WHERE Reputation >= '##MinimalReputation:int?10##' AND (UPPER(Location) LIKE UPPER('%algeria%')) ORDER BY Reputation DESC LIMIT 1000 |
Which nationality has a Ship of minteh? | CREATE TABLE table_55009 ("Date" text,"Ship" text,"Type" text,"Nationality" text,"Tonnage GRT" real) | SELECT "Nationality" FROM table_55009 WHERE "Ship" = 'minteh' |
Who replaced the outgoing manager H sn zkara? | CREATE TABLE table_74060 ("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_74060 WHERE "Outgoing manager" = 'Hüsnü Özkara' |
among patients who were prescribed haldol after they had been diagnosed with third spacing show me the three year survival rate. | CREATE TABLE medication (medicationid number,patientunitstayid number,drugname text,dosage text,routeadmin text,drugstarttime time,drugstoptime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissio... | SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 3 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid... |
Who was the batting team in the 2006 season? | CREATE TABLE table_name_61 (batting_team VARCHAR,season VARCHAR) | SELECT batting_team FROM table_name_61 WHERE season = "2006" |
what was the last time that the arterial bp mean of patient 26817 was, on the last icu visit, greater than 58.0? | 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 microbiologyevents (row_id number,subject_id number,hadm_id number,charttime time,spec_type_desc text,org_name text)CREATE TABLE d_items (row_id numbe... | SELECT chartevents.charttime 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 = 26817) AND NOT icustays.outtime IS NULL ORDER BY icustays.intime DESC LIMIT 1) AND chartevents.itemid... |
What are the imperial size for the unit that has a ratio of 1/20? | CREATE TABLE table_name_11 (imperial VARCHAR,ratio VARCHAR) | SELECT imperial FROM table_name_11 WHERE ratio = "1/20" |
acute myocardial infarction or pulmonary embolization | CREATE TABLE table_train_41 ("id" int,"pulmonary_embolization" bool,"hiv_infection" bool,"neutrophil_count" int,"renal_disease" bool,"liver_disease" bool,"serum_creatinine" float,"myocardial_infarction" bool,"NOUSE" float) | SELECT * FROM table_train_41 WHERE myocardial_infarction = 1 OR pulmonary_embolization = 1 |
When the tries against is 90 how many points are there? | CREATE TABLE table_39094 ("Club" text,"Played" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Tries for" text,"Tries against" text,"Try bonus" text,"Losing bonus" text,"Points" text) | SELECT "Points" FROM table_39094 WHERE "Tries against" = '90' |
Which event resulted in loss with an Opponent of maurice smith? | CREATE TABLE table_name_52 (event VARCHAR,res VARCHAR,opponent VARCHAR) | SELECT event FROM table_name_52 WHERE res = "loss" AND opponent = "maurice smith" |
List the hardware model name and company name for the phone whose screen mode type is 'Graphics. | CREATE TABLE chip_model (model_name text,launch_year number,ram_mib number,rom_mib number,slots text,wifi text,bluetooth text)CREATE TABLE screen_mode (graphics_mode number,char_cells text,pixels text,hardware_colours number,used_kb number,map text,type text)CREATE TABLE phone (company_name text,hardware_model_name tex... | SELECT T2.hardware_model_name, T2.company_name FROM screen_mode AS T1 JOIN phone AS T2 ON T1.graphics_mode = T2.screen_mode WHERE T1.type = "Graphics" |
What percentage of browsers were using Internet Explorer in April 2009? | CREATE TABLE table_79423 ("Date" text,"Internet Explorer" text,"Firefox" text,"Safari" text,"Opera" text) | SELECT "Internet Explorer" FROM table_79423 WHERE "Date" = 'april 2009' |
Show me mean age by born state in a histogram, show Y-axis in descending order. | CREATE TABLE head (head_ID int,name text,born_state text,age real)CREATE TABLE department (Department_ID int,Name text,Creation text,Ranking int,Budget_in_Billions real,Num_Employees real)CREATE TABLE management (department_ID int,head_ID int,temporary_acting text) | SELECT born_state, AVG(age) FROM head GROUP BY born_state ORDER BY AVG(age) DESC |
For those employees who do not work in departments with managers that have ids between 100 and 200, find hire_date and the sum of department_id bin hire_date by weekday, and visualize them by a bar chart, and show y axis in ascending order. | 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 job_history (EMPLOYEE_ID decimal(6,0)... | SELECT HIRE_DATE, SUM(DEPARTMENT_ID) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(DEPARTMENT_ID) |
How much money was raised in the 2Q when the total receipts were $63,075,927? | CREATE TABLE table_55349 ("Candidate" text,"Money Raised,2Q" text,"Loans Received,2Q" text,"Money Spent,2Q" text,"Total Receipts" text,"Cash On Hand" text) | SELECT "Money Raised, 2Q" FROM table_55349 WHERE "Total Receipts" = '$63,075,927' |
Return a bar chart showing how many customers whose contact channel code is email for each weekday. | CREATE TABLE Customer_Contact_Channels (customer_id INTEGER,channel_code VARCHAR(15),active_from_date DATETIME,active_to_date DATETIME,contact_number VARCHAR(50))CREATE TABLE Addresses (address_id INTEGER,address_content VARCHAR(80),city VARCHAR(50),zip_postcode VARCHAR(20),state_province_county VARCHAR(50),country VAR... | SELECT active_from_date, COUNT(active_from_date) FROM Customers AS t1 JOIN Customer_Contact_Channels AS t2 ON t1.customer_id = t2.customer_id WHERE t2.channel_code = 'Email' |
What is the medal total when there is 2 gold medals, and Brazil (BRA) is the nation? | CREATE TABLE table_name_2 (total VARCHAR,gold VARCHAR,nation VARCHAR) | SELECT total FROM table_name_2 WHERE gold = 2 AND nation = "brazil (bra)" |
Which year had playoffs of champion? | CREATE TABLE table_name_27 (year INTEGER,playoffs VARCHAR) | SELECT AVG(year) FROM table_name_27 WHERE playoffs = "champion" |
how many patients whose diagnoses long title is ulcer of other part of foot and drug type is base? | 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 diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.long_title = "Ulcer of other part of foot" AND prescriptions.drug_type = "BASE" |
Question per Day on StackExchange. | CREATE TABLE Comments (Id number,PostId number,Score number,Text text,CreationDate time,UserDisplayName text,UserId number,ContentLicense text)CREATE TABLE PostFeedback (Id number,PostId number,IsAnonymous boolean,VoteTypeId number,CreationDate time)CREATE TABLE Badges (Id number,UserId number,Name text,Date time,Class... | SELECT Date AS "dates", ROUND((SUM(pd.Questions) * 1.00 / COUNT(pd.Date)), 2) AS "questions_per_day" FROM (SELECT SUM(CASE WHEN p.PostTypeId = 1 THEN 1 ELSE 0 END) AS "questions", DATE(p.CreationDate) AS "date" FROM Posts AS p GROUP BY DATE(p.CreationDate)) AS pd GROUP BY Date ORDER BY Date DESC |
What was the date of the game against Northwestern? | CREATE TABLE table_67219 ("Date" text,"Opponent" text,"City" text,"Result" text,"Score" text) | SELECT "Date" FROM table_67219 WHERE "Opponent" = 'northwestern' |
What is the team #1 that has unics kazan for team #2? | CREATE TABLE table_name_97 (team__number1 VARCHAR,team__number2 VARCHAR) | SELECT team__number1 FROM table_name_97 WHERE team__number2 = "unics kazan" |
Visualize a bar chart about the distribution of Nationality and the amount of Nationality , and group by attribute Nationality. | CREATE TABLE stadium (ID int,name text,Capacity int,City text,Country text,Opening_year int)CREATE TABLE record (ID int,Result text,Swimmer_ID int,Event_ID int)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 te... | SELECT Nationality, COUNT(Nationality) FROM swimmer GROUP BY Nationality |
How many points total are there later than 2003? | CREATE TABLE table_7468 ("Year" real,"Entrant" text,"Chassis" text,"Engine" text,"Points" real) | SELECT SUM("Points") FROM table_7468 WHERE "Year" > '2003' |
How many positions did the player from Spring High School play? | CREATE TABLE table_17058 ("Player" text,"Position" text,"School" text,"Hometown" text,"MLB Draft" text) | SELECT COUNT("Position") FROM table_17058 WHERE "School" = 'Spring High School' |
What is the average number of regencies (kabupaten) with more than 331 villages and a 2010 population census of 12,982,204? | CREATE TABLE table_8667 ("Province" text,"Capital" text,"Population at 2010 Census" real,"Area (km\u00b2)" real,"Density (2010)" real,"Geographical unit" text,"Number of Cities (kota)" real,"Number of Regencies (kabupaten)" real,"Number of Districts (kecamatan)" real,"Villages" real) | SELECT AVG("Number of Regencies (kabupaten)") FROM table_8667 WHERE "Villages" > '331' AND "Population at 2010 Census" = '12,982,204' |
What was the date of the game at Lake Oval? | CREATE TABLE table_10611 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text) | SELECT "Date" FROM table_10611 WHERE "Venue" = 'lake oval' |
Show all male student ids who don't play football. | CREATE TABLE plays_games (stuid number,gameid number,hours_played number)CREATE TABLE sportsinfo (stuid number,sportname text,hoursperweek number,gamesplayed number,onscholarship text)CREATE TABLE video_games (gameid number,gname text,gtype text)CREATE TABLE student (stuid number,lname text,fname text,age number,sex te... | SELECT stuid FROM student WHERE sex = 'M' EXCEPT SELECT stuid FROM sportsinfo WHERE sportname = "Football" |
How many numbers were listed under Silver Medals for Portsmouth HS? | CREATE TABLE table_17965 ("Ensemble" text,"Gold Medals" real,"Silver Medals" real,"Bronze Medals" real,"Total Medals" real) | SELECT COUNT("Silver Medals") FROM table_17965 WHERE "Ensemble" = 'Portsmouth HS' |
What are the id of each employee and the number of document destruction authorised by that employee. Visualize by scatter chart. | CREATE TABLE Ref_Calendar (Calendar_Date DATETIME,Day_Number INTEGER)CREATE TABLE Employees (Employee_ID INTEGER,Role_Code CHAR(15),Employee_Name VARCHAR(255),Gender_MFU CHAR(1),Date_of_Birth DATETIME,Other_Details VARCHAR(255))CREATE TABLE Documents_to_be_Destroyed (Document_ID INTEGER,Destruction_Authorised_by_Employ... | SELECT Destruction_Authorised_by_Employee_ID, COUNT(*) FROM Documents_to_be_Destroyed GROUP BY Destruction_Authorised_by_Employee_ID |
In what Season were then less than 3 Races with less than 1 Win? | CREATE TABLE table_42158 ("Season" real,"Series" text,"Team" text,"Races" real,"Wins" real,"Points" text,"Position" text) | SELECT AVG("Season") FROM table_42158 WHERE "Races" < '3' AND "Wins" < '1' |
Which years have a Decile smaller than 2, and an Area of mohaka? | CREATE TABLE table_name_97 (years VARCHAR,decile VARCHAR,area VARCHAR) | SELECT years FROM table_name_97 WHERE decile < 2 AND area = "mohaka" |
Search posts by multiple comment text ('OR' operator) and UserId. | CREATE TABLE FlagTypes (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)CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostType... | SELECT Id AS "comment_link", Score, Text FROM Comments WHERE (UPPER(Text) LIKE UPPER('%##CommentText##%') OR UPPER(Text) LIKE UPPER('%##CommentText2##%')) AND UserId = '##UserId##' ORDER BY Score DESC |
Name the sport for puerto rico and year of 2000 | CREATE TABLE table_name_44 (sport VARCHAR,country VARCHAR,year VARCHAR) | SELECT sport FROM table_name_44 WHERE country = "puerto rico" AND year = 2000 |
What is the main span feet from opening year of 1936 in the United States with a rank greater than 47 and 421 main span metres? | CREATE TABLE table_name_43 (main_span_feet VARCHAR,main_span_metres VARCHAR,rank VARCHAR,year_opened VARCHAR,country VARCHAR) | SELECT main_span_feet FROM table_name_43 WHERE year_opened = 1936 AND country = "united states" AND rank > 47 AND main_span_metres = "421" |
in week 3 the winning couple in guest bedroom 2 was kyal and kara but the chumps were | CREATE TABLE table_204_269 (id number,"week" number,"room" text,"winning couple" text,"2nd couple" text,"3rd couple" text,"chumps" text) | SELECT "chumps" FROM table_204_269 WHERE "week" = 3 AND "room" = 'guest bedroom 2' |
I want to know the pens with conv of 6 | CREATE TABLE table_name_10 (pens VARCHAR,conv VARCHAR) | SELECT pens FROM table_name_10 WHERE conv = "6" |
Lowest question-score to comment-score ratios. | 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 boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwne... | SELECT Comments.Id AS "comment_link", Posts.Score AS "post_score", Comments.Score AS "comment_score", Comments.Score / Posts.Score AS "score_ratio" FROM Comments JOIN Posts ON Comments.PostId = Posts.Id WHERE Posts.Score != 0 AND Posts.PostTypeId = 1 ORDER BY 'score_ratio' LIMIT 100 |
which constituency is listed on top ? | CREATE TABLE table_203_627 (id number,"no." number,"constituency" text,"created" number,"seats" number,"change" number) | SELECT "constituency" FROM table_203_627 WHERE id = 1 |
Name the award name for black ocean current | CREATE TABLE table_20167 ("Year / Theme" text,"Award name" text,"Team name" text,"Team number" real,"City,State/Country" text) | SELECT "Award name" FROM table_20167 WHERE "Team name" = 'BLACK OCEAN CURRENT' |
what is the highest clean & jerk when total (kg) is 200.0 and snatch is more than 87.5? | CREATE TABLE table_57448 ("Name" text,"Bodyweight" real,"Snatch" real,"Clean & jerk" real,"Total (kg)" text) | SELECT MAX("Clean & jerk") FROM table_57448 WHERE "Total (kg)" = '200.0' AND "Snatch" > '87.5' |
What is the least total number of medals when the bronze medals is 1, and Czech Republic (CZE) is the nation? | CREATE TABLE table_name_46 (total INTEGER,bronze VARCHAR,nation VARCHAR) | SELECT MIN(total) FROM table_name_46 WHERE bronze = 1 AND nation = "czech republic (cze)" |
What is the date of Game 50? | CREATE TABLE table_11960407_5 (date VARCHAR,game VARCHAR) | SELECT date FROM table_11960407_5 WHERE game = 50 |
What is the highest Lane number of a person with a time of 55.94 with a Rank that's bigger than 8? | CREATE TABLE table_name_68 (lane INTEGER,time VARCHAR,rank VARCHAR) | SELECT MAX(lane) FROM table_name_68 WHERE time > 55.94 AND rank > 8 |
Show me a line chart for how many players enter hall of fame each year? | CREATE TABLE salary (year INTEGER,team_id TEXT,league_id TEXT,player_id TEXT,salary INTEGER)CREATE TABLE pitching_postseason (player_id TEXT,year INTEGER,round TEXT,team_id TEXT,league_id TEXT,w INTEGER,l INTEGER,g INTEGER,gs INTEGER,cg INTEGER,sho INTEGER,sv INTEGER,ipouts INTEGER,h INTEGER,er INTEGER,hr INTEGER,bb IN... | SELECT yearid, COUNT(*) FROM hall_of_fame GROUP BY yearid |
Which series occurred when the 7800 was 5040.00? | CREATE TABLE table_27680 ("22/06/2008" text,"Indonesia Super Series 2008" text,"S.Series" text,"7800.00" text,"Runner-Up" text) | SELECT "Indonesia Super Series 2008" FROM table_27680 WHERE "7800.00" = '5040.00' |
What is the Netflix episode that has a series episode of 6-02? | CREATE TABLE table_name_98 (netflix VARCHAR,series_ep VARCHAR) | SELECT netflix FROM table_name_98 WHERE series_ep = "6-02" |
what is the venue on 21 june 1987? | CREATE TABLE table_50528 ("Year" text,"Winner" text,"Runner-up" text,"Score" text,"Venue" text) | SELECT "Venue" FROM table_50528 WHERE "Year" = '21 june 1987' |
List document type codes and the number of documents in each code Visualize by bar chart, rank in descending by the y-axis please. | CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Statements (Statement_ID INTEGER,Statement_Details VARCHAR(255))CREATE TABLE Accounts (Account_ID INTEGER,Statement_ID INTEGER,Account_Details VARCHAR(255))CREATE TABLE Ref_Document_Types (Docu... | SELECT Document_Type_Code, COUNT(*) FROM Documents GROUP BY Document_Type_Code ORDER BY COUNT(*) DESC |
At which restaurant did the students spend the least amount of time? List restaurant and the time students spent on in total. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE visits_restaurant (stuid number,resid number,time time,spent number)CREATE TABLE restaurant_type (restypeid number,restypename text,restypedescription text)CREATE TABLE type_of_restaurant... | SELECT restaurant.resname, SUM(visits_restaurant.spent) FROM visits_restaurant JOIN restaurant ON visits_restaurant.resid = restaurant.resid GROUP BY restaurant.resid ORDER BY SUM(visits_restaurant.spent) LIMIT 1 |
What Report is on June 3, 2000? | CREATE TABLE table_name_85 (report VARCHAR,date VARCHAR) | SELECT report FROM table_name_85 WHERE date = "june 3, 2000" |
how many won 83 points for? | CREATE TABLE table_23689 ("Club" text,"Played" text,"Won" text,"Drawn" text,"Lost" text,"Points for" text,"Points against" text,"Points difference" text,"Bonus Points" text,"Points" text) | SELECT "Won" FROM table_23689 WHERE "Points for" = '83' |
Show all dates of transactions whose type code is 'SALE', and count them by a line chart | CREATE TABLE Sales (sales_transaction_id INTEGER,sales_details VARCHAR(255))CREATE TABLE Purchases (purchase_transaction_id INTEGER,purchase_details VARCHAR(255))CREATE TABLE Investors (investor_id INTEGER,Investor_details VARCHAR(255))CREATE TABLE Lots (lot_id INTEGER,investor_id INTEGER,lot_details VARCHAR(255))CREAT... | SELECT date_of_transaction, COUNT(date_of_transaction) FROM Transactions WHERE transaction_type_code = "SALE" |
count the number of patients whose admission type is elective and lab test fluid is other body fluid? | 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 COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND lab.fluid = "Other Body Fluid" |
Where to see how long I have been a member of SO?. http://meta.stackoverflow.com/questions/334109/where-to-see-how-long-i-have-been-a-member-of-so | 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 Id AS "user_link", CreationDate FROM Users WHERE Id = '##userid##' |
What is the grid 13 time score? | CREATE TABLE table_58220 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real) | SELECT "Time/Retired" FROM table_58220 WHERE "Grid" = '13' |
is leonard messel or royalty larger in size ? | CREATE TABLE table_203_699 (id number,"name" text,"parentage" text,"size" text,"flower colour" text,"flower type" text) | SELECT "name" FROM table_203_699 WHERE "name" IN ('leonard messel', 'royalty') ORDER BY "size" DESC LIMIT 1 |
what were the number of patients who received an cortisol test this year? | CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,discha... | SELECT COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol' AND DATETIME(lab.labresulttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
Who is the sprint classification where Francisco Ventoso wins? | CREATE TABLE table_31100 ("Stage" real,"Winner" text,"General Classification" text,"Mountains Classification" text,"Sprint Classification" text,"Young Rider Classification" text,"Team Classification" text,"Aggressive Rider" text) | SELECT "Sprint Classification" FROM table_31100 WHERE "Winner" = 'Francisco Ventoso' |
give me the number of married patients admitted in hospital before 2119. | CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE 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 WHERE demographic.marital_status = "MARRIED" AND demographic.admityear < "2119" |
What type of song is larger than 8 and named ? | CREATE TABLE table_name_50 (kind_of_the_song VARCHAR,number VARCHAR,name_of_the_song VARCHAR) | SELECT kind_of_the_song FROM table_name_50 WHERE number > 8 AND name_of_the_song = "實情" |
For those records from the products and each product's manufacturer, return a bar chart about the distribution of name and revenue , and group by attribute headquarter, display by the bars in asc. | CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER) | SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Headquarter, T1.Name ORDER BY T1.Name |
What is the rank of a result with a population of 99,962 in 2000? | CREATE TABLE table_69215 ("Rank (CSA)" text,"State(s)" text,"2007 Estimate" text,"2000 Population" text,"Percent Change (1990\u20132000)" text) | SELECT "Rank (CSA)" FROM table_69215 WHERE "2000 Population" = '99,962' |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.