instruction stringlengths 0 1.06k | input stringlengths 11 5.3k | response stringlengths 2 4.44k |
|---|---|---|
List the state names and the number of customers living in each state. | CREATE TABLE Order_Deliveries (location_code VARCHAR(10),actual_order_id INTEGER,delivery_status_code VARCHAR(10),driver_employee_id INTEGER,truck_id INTEGER,delivery_date DATETIME)CREATE TABLE Regular_Order_Products (regular_order_id INTEGER,product_id INTEGER)CREATE TABLE Employees (employee_id INTEGER,employee_addre... | SELECT state_province_county, COUNT(*) FROM Customer_Addresses AS t1 JOIN Addresses AS t2 ON t1.address_id = t2.address_id GROUP BY t2.state_province_county |
Name the nominating festival for director of 2004 | CREATE TABLE table_71044 ("Category" text,"Film" text,"Director(s)" text,"Country" text,"Nominating Festival" text) | SELECT "Nominating Festival" FROM table_71044 WHERE "Director(s)" = '2004' |
Name the barrel length for rear sight a2 for factory compensator | CREATE TABLE table_17839 ("Colt model no." text,"Name" text,"Stock" text,"Fire control" text,"Rear sight" text,"Forward assist" text,"Case deflector" text,"Barrel length" text,"Barrel profile" text,"Barrel twist" text,"Hand guards" text,"Bayonet Lug" text,"Muzzle device" text) | SELECT "Barrel length" FROM table_17839 WHERE "Rear sight" = 'A2' AND "Muzzle device" = 'Factory compensator' |
How many years was there a team that was part of the usisl pro league? | CREATE TABLE table_77790 ("Year" real,"Division" real,"League" text,"Reg. Season" text,"Playoffs" text,"Open Cup" text) | SELECT COUNT("Year") FROM table_77790 WHERE "League" = 'usisl pro league' |
List the number of games in each season with a line chart, and show x-axis in ascending order. | CREATE TABLE injury_accident (game_id int,id int,Player text,Injury text,Number_of_matches text,Source text)CREATE TABLE stadium (id int,name text,Home_Games int,Average_Attendance real,Total_Attendance real,Capacity_Percentage real)CREATE TABLE game (stadium_id int,id int,Season int,Date text,Home_team text,Away_team ... | SELECT Season, COUNT(Season) FROM game ORDER BY Season |
Which Away captain has a Date of 2,3,4,5 january 1999? | CREATE TABLE table_15458 ("Date" text,"Home captain" text,"Away captain" text,"Venue" text,"Result" text) | SELECT "Away captain" FROM table_15458 WHERE "Date" = '2,3,4,5 january 1999' |
had patient 27172 been admitted in 2105 in hospital? | CREATE TABLE d_items (row_id number,itemid number,label text,linksto text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE cost (row_id number,subject_id number,hadm_id number,event_type text,event_id number,chargetime time,co... | SELECT COUNT(*) > 0 FROM admissions WHERE admissions.subject_id = 27172 AND STRFTIME('%y', admissions.admittime) = '2105' |
How many laps does roberto moreno have? | CREATE TABLE table_78488 ("Driver" text,"Constructor" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Laps" FROM table_78488 WHERE "Driver" = 'roberto moreno' |
give me the number of patients whose year of death is less than or equal to 2155 and procedure icd9 code is 4632? | CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethni... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.dod_year <= "2155.0" AND procedures.icd9_code = "4632" |
Which Date has a Location of davos, and a Time of 45.7? | CREATE TABLE table_name_86 (date VARCHAR,location VARCHAR,time VARCHAR) | SELECT date FROM table_name_86 WHERE location = "davos" AND time = "45.7" |
who is the incumbent where the district is florida 9? | CREATE TABLE table_1341663_10 (incumbent VARCHAR,district VARCHAR) | SELECT incumbent FROM table_1341663_10 WHERE district = "Florida 9" |
What is the year of the disc with a catalogue number mash02? | CREATE TABLE table_10360 ("Catalogue Number" text,"Artist" text,"Tracks" text,"Type" text,"Year" real) | SELECT "Year" FROM table_10360 WHERE "Catalogue Number" = 'mash02' |
Group all my answers by votes. | CREATE TABLE PostTypes (Id number,Name text)CREATE TABLE Tags (Id number,TagName text,Count number,ExcerptPostId number,WikiPostId number)CREATE TABLE Posts (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number... | SELECT Votes, COUNT(*) AS AnswersCount FROM (SELECT Votes FROM (SELECT SUM(CASE WHEN VoteTypeId IS NULL THEN 0 ELSE ((CASE WHEN VoteTypeId = 2 THEN 1 ELSE ((CASE WHEN VoteTypeId = 3 THEN -1 ELSE NULL END)) END)) END) AS Votes FROM Posts LEFT JOIN Votes ON Votes.PostId = Posts.Id WHERE Posts.OwnerUserId = @UserId GROUP ... |
Find the average age and number of male students (with sex M) from each city. | CREATE TABLE student (stuid number,lname text,fname text,age number,sex text,major number,advisor number,city_code text)CREATE TABLE dorm_amenity (amenid number,amenity_name text)CREATE TABLE dorm (dormid number,dorm_name text,student_capacity number,gender text)CREATE TABLE lives_in (stuid number,dormid number,room_nu... | SELECT COUNT(*), AVG(age), city_code FROM student WHERE sex = 'M' GROUP BY city_code |
What is the day and date of game 2? | CREATE TABLE table_name_20 (day VARCHAR,_date VARCHAR,game VARCHAR) | SELECT day, _date FROM table_name_20 WHERE game = "2" |
With the score of 6 3, 2 6, [10 8] and played on clay who was the opponent? | CREATE TABLE table_name_69 (opponent VARCHAR,surface VARCHAR,score VARCHAR) | SELECT opponent FROM table_name_69 WHERE surface = "clay" AND score = "6–3, 2–6, [10–8]" |
What is the name of the Senator in the O District who assumed office in 2013? | CREATE TABLE table_74584 ("District" text,"Name" text,"Party" text,"Residence" text,"Assumed office" real,"Next election" real) | SELECT "Name" FROM table_74584 WHERE "Assumed office" = '2013' AND "District" = 'o' |
Which Record has a Score of 4 4, and Points of 17? | CREATE TABLE table_name_91 (record VARCHAR,score VARCHAR,points VARCHAR) | SELECT record FROM table_name_91 WHERE score = "4–4" AND points = 17 |
what is the country when the score is 68-72-67=207? | CREATE TABLE table_name_75 (country VARCHAR,score VARCHAR) | SELECT country FROM table_name_75 WHERE score = 68 - 72 - 67 = 207 |
when was patient 19427 for the first time prescribed a drug the last month? | 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 transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREA... | SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 19427) AND DATETIME(prescriptions.startdate, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-1 month') ORDER BY prescriptions.startdate LIMIT 1 |
What is the sum of the attendance during the game against the philadelphia eagles after week 9? | CREATE TABLE table_name_58 (attendance INTEGER,opponent VARCHAR,week VARCHAR) | SELECT SUM(attendance) FROM table_name_58 WHERE opponent = "philadelphia eagles" AND week > 9 |
Who is the home team that played at venue MCG? | CREATE TABLE table_name_3 (home_team VARCHAR,venue VARCHAR) | SELECT home_team FROM table_name_3 WHERE venue = "mcg" |
If team two is Lan s, what was the total number of points? | CREATE TABLE table_16795394_3 (points VARCHAR,team__number2 VARCHAR) | SELECT COUNT(points) FROM table_16795394_3 WHERE team__number2 = "Lanús" |
What was the record for the Chargers on Week 10? | CREATE TABLE table_43476 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Game Site" text,"Record" text,"Attendance" text) | SELECT "Record" FROM table_43476 WHERE "Week" = '10' |
Return the average price for each product type by a bar chart, and display X in desc order please. | CREATE TABLE Product_Suppliers (product_id INTEGER,supplier_id INTEGER,date_supplied_from DATETIME,date_supplied_to DATETIME,total_amount_purchased VARCHAR(80),total_value_purchased DECIMAL(19,4))CREATE TABLE Customer_Addresses (customer_id INTEGER,address_id INTEGER,date_from DATETIME,date_to DATETIME)CREATE TABLE Dep... | SELECT product_type_code, AVG(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC |
What is the lowest number of votes in elections that had 34.39% of seats contested? | CREATE TABLE table_2644 ("Party Name" text,"States contested" real,"Seats contested" real,"Seats won" real,"No. of Votes" real,"% of Votes" text,"% in Seats contested" text,"Forfeited in seats" real) | SELECT MIN("No. of Votes") FROM table_2644 WHERE "% in Seats contested" = '34.39%' |
i want a flight on saturday from MINNEAPOLIS to LONG BEACH | CREATE TABLE month (month_number int,month_name text)CREATE TABLE compartment_class (compartment varchar,class_type 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_flight_number int,dual_airline varchar,service_name... | 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 = 'LONG BEACH' AND date_day.day_number = 26 AND date_day.month_number = 7 AN... |
Where was the tournament won by Hale Irwin (19)? | CREATE TABLE table_name_93 (location VARCHAR,winner VARCHAR) | SELECT location FROM table_name_93 WHERE winner = "hale irwin (19)" |
Name the ptor-austronesian for father | CREATE TABLE table_20155 ("Kinship" text,"Proto-Austronesian" text,"Proto-Malayo-Polynesian" text,"Proto-Oceanic" text,"Proto-Polynesian" text) | SELECT "Proto-Austronesian" FROM table_20155 WHERE "Kinship" = 'father' |
I want to know the pens with conv of 6 | CREATE TABLE table_52572 ("Player" text,"Tries" text,"Conv" text,"Pens" text,"Drop" text,"Venue" text,"Date" text) | SELECT "Pens" FROM table_52572 WHERE "Conv" = '6' |
What is the 12::37.35 when hengelo , netherlands is hengelo, netherlands? | CREATE TABLE table_26532 ("World record" text,"Kenenisa Bekele (ETH)" text,"12:37.35" text,"Hengelo,Netherlands" text,"31 May 2004" text) | SELECT "12:37.35" FROM table_26532 WHERE "Hengelo , Netherlands" = 'Hengelo, Netherlands' |
Which Home Town has a Took Office of 1983, and a District larger than 15? | CREATE TABLE table_name_60 (home_town VARCHAR,took_office VARCHAR,district VARCHAR) | SELECT home_town FROM table_name_60 WHERE took_office = 1983 AND district > 15 |
Draw a bar chart of location versus how many location, I want to sort by the y-axis in descending please. | CREATE TABLE wrestler (Wrestler_ID int,Name text,Reign text,Days_held text,Location text,Event text)CREATE TABLE Elimination (Elimination_ID text,Wrestler_ID text,Team text,Eliminated_By text,Elimination_Move text,Time text) | SELECT Location, COUNT(Location) FROM wrestler GROUP BY Location ORDER BY COUNT(Location) DESC |
tell me the average total hospital cost that includes colloid administration - hydroxyethylstarch until 2104? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE treatment (treatmentid number,patientunitstayi... | SELECT AVG(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 treatment.patientunitstayid FROM treatment WHERE treatment.treatmentname = 'colloid administration - hydroxyethylstarch'... |
Is the subject id 74032 married, find his religion ? | 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 demographic.marital_status, demographic.religion FROM demographic WHERE demographic.subject_id = "74032" |
What type has a date of 1 june? | CREATE TABLE table_name_70 (type VARCHAR,date VARCHAR) | SELECT type FROM table_name_70 WHERE date = "1 june" |
What is the year of the Premios Carlos Gardel 2009 award? | CREATE TABLE table_name_58 (year VARCHAR,award VARCHAR) | SELECT year FROM table_name_58 WHERE award = "premios carlos gardel 2009" |
Who is in week 4 if week 5 is [month ended] and week 2 is April Ireland? | CREATE TABLE table_61290 ("Week 1" text,"Week 2" text,"Week 3" text,"Week 4" text,"Week 5" text) | SELECT "Week 4" FROM table_61290 WHERE "Week 5" = '[month ended]' AND "Week 2" = 'april ireland' |
Who was the runner-up when the winning score was 28 (66-67-68-64-67=332)? | CREATE TABLE table_name_81 (runner_s__up VARCHAR,winning_score VARCHAR) | SELECT runner_s__up FROM table_name_81 WHERE winning_score = –28(66 - 67 - 68 - 64 - 67 = 332) |
Name the most released for right here, right now | CREATE TABLE table_27007 ("Artist/Band" text,"Song" text,"Disney affiliated" text,"Released" real,"US exclusive" text,"EU exclusive" text) | SELECT MAX("Released") FROM table_27007 WHERE "Song" = 'Right Here, Right Now' |
what time slot did the show have for its first 6 episodes ? | CREATE TABLE table_204_384 (id number,"#" number,"air date" text,"timeslot (est)" text,"season" text,"rating" number,"share" number,"18-49 (rating/share)" text,"viewers (m)" number,"weekly rank (#)" number) | SELECT "timeslot (est)" FROM table_204_384 WHERE "#" = 6 |
how many patients with tietze's disease are insured by the government? | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.insurance = "Government" AND diagnoses.long_title = "Tietze's disease" |
what was luis jesus ' quickest finish time ? | CREATE TABLE table_204_98 (id number,"year" number,"competition" text,"venue" text,"position" text,"event" text,"notes" text) | SELECT MIN("notes") FROM table_204_98 |
When was the opposition sydney fc on round 19? | CREATE TABLE table_name_33 (date VARCHAR,opposition VARCHAR,round VARCHAR) | SELECT date FROM table_name_33 WHERE opposition = "sydney fc" AND round = "round 19" |
What is the fastest lap for Seiji Ara? | CREATE TABLE table_name_49 (fastest_lap VARCHAR,winning_driver VARCHAR) | SELECT fastest_lap FROM table_name_49 WHERE winning_driver = "seiji ara" |
what is admission type and primary disease of subject name cynthia gomez? | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT demographic.admission_type, demographic.diagnosis FROM demographic WHERE demographic.name = "Cynthia Gomez" |
In what Year is the Works No. 2040-2049? | CREATE TABLE table_name_80 (year VARCHAR,works_no VARCHAR) | SELECT year FROM table_name_80 WHERE works_no = "2040-2049" |
WWhich rder had a vehicle manufactured by kr211v? | CREATE TABLE table_76652 ("Rider" text,"Manufacturer" text,"Laps" text,"Time/Retired" text,"Grid" text) | SELECT "Rider" FROM table_76652 WHERE "Manufacturer" = 'kr211v' |
what is the name of a drug that patient 033-250 has been prescribed for two times until 13 months ago? | CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid ... | SELECT t1.drugname FROM (SELECT medication.drugname, COUNT(medication.drugstarttime) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '033... |
what are the top three most frequent laboratory tests that followed in the same hospital visit for patients who took anticonvulsants - valproate in 2104? | CREATE TABLE cost (costid number,uniquepid text,patienthealthsystemstayid number,eventtype text,eventid number,chargetime time,cost number)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiasto... | SELECT t3.labname FROM (SELECT t2.labname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'anticonvulsants -... |
What is the percentage of the Labour Party on the Harris Poll | CREATE TABLE table_159614_2 (harris VARCHAR,party VARCHAR) | SELECT harris FROM table_159614_2 WHERE party = "Labour" |
Show me a scatter plot of avg(price) and the average of score for . | CREATE TABLE appellations (No INTEGER,Appelation TEXT,County TEXT,State TEXT,Area TEXT,isAVA 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 grapes (ID INTEGER,Grape TEXT,Color TEXT) | SELECT AVG(Price), AVG(Score) FROM wine GROUP BY AVG(Price) |
In Silver Bow County, Montana, when the capicity is more than 45 tons, what's the highest rank found? | CREATE TABLE table_44683 ("Rank" real,"Mine" text,"County and State" text,"Operator" text,"Source of copper" text,"Capacity (thousands of metric tons)" real) | SELECT MAX("Rank") FROM table_44683 WHERE "County and State" = 'silver bow county, montana' AND "Capacity (thousands of metric tons)" > '45' |
When Tujunga is moderate, what is La Crescenta-Montrose? | CREATE TABLE table_name_71 (la_crescenta__montrose VARCHAR,tujunga VARCHAR) | SELECT la_crescenta__montrose FROM table_name_71 WHERE tujunga = "moderate" |
Which Away team uses Princes Park as it's venue? | CREATE TABLE table_name_77 (away_team VARCHAR,venue VARCHAR) | SELECT away_team FROM table_name_77 WHERE venue = "princes park" |
List the names of aircrafts and the number of times it won matches by a bar chart, and list y axis in desc order. | CREATE TABLE match (Round real,Location text,Country text,Date text,Fastest_Qualifying text,Winning_Pilot text,Winning_Aircraft text)CREATE TABLE airport (Airport_ID int,Airport_Name text,Total_Passengers real,%_Change_2007 text,International_Passengers real,Domestic_Passengers real,Transit_Passengers real,Aircraft_Mov... | SELECT Aircraft, COUNT(*) FROM aircraft AS T1 JOIN match AS T2 ON T1.Aircraft_ID = T2.Winning_Aircraft GROUP BY T2.Winning_Aircraft ORDER BY COUNT(*) DESC |
How many games had Montreal Canadiens as an opponent? | CREATE TABLE table_name_24 (game INTEGER,opponent VARCHAR) | SELECT SUM(game) FROM table_name_24 WHERE opponent = "montreal canadiens" |
What's the number of episodes with a broadcast order s04 e07? | CREATE TABLE table_17620 ("Number in series" real,"Broadcast Order" text,"Title" text,"Villain/s" text,"U.S. Air Date" text,"Production Code" text) | SELECT COUNT("Number in series") FROM table_17620 WHERE "Broadcast Order" = 'S04 E07' |
What is every value for Croats when value for Romanians is 16.65%? | CREATE TABLE table_2374338_2 (croats VARCHAR,romanians VARCHAR) | SELECT croats FROM table_2374338_2 WHERE romanians = "16.65%" |
what are the cost of morning flights from ATLANTA to BALTIMORE | CREATE TABLE ground_service (city_code text,airport_code text,transport_type text,ground_fare int)CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE flight_fare (flight_id int,fare_id int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time... | SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.cit... |
what are the methods of consumption of levetiracetam solution? | CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE procedures_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE patients (row_id number,subject_id number,gender text,dob time,dod time)CREATE TABLE microbiologyevents (row_id number,subject_id number,... | SELECT DISTINCT prescriptions.route FROM prescriptions WHERE prescriptions.drug = 'levetiracetam solution' |
Can you tell me the Time that has the Lane of 8? | CREATE TABLE table_64406 ("Rank" real,"Lane" real,"Name" text,"Nationality" text,"Time" text) | SELECT "Time" FROM table_64406 WHERE "Lane" = '8' |
Who was the opponent, during the game at the location of keyarena at seattle center? | CREATE TABLE table_47291 ("Game" text,"Date" text,"Opponent" text,"Score" text,"Location/Attendance" text,"Record" text) | SELECT "Opponent" FROM table_47291 WHERE "Location/Attendance" = 'keyarena at seattle center' |
What is the enrollment number for the public institution in Golden, Colorado founded after 1874? | CREATE TABLE table_40710 ("Location" text,"Control" text,"Type" text,"Enrollment" real,"Founded" real) | SELECT AVG("Enrollment") FROM table_40710 WHERE "Control" = 'public' AND "Location" = 'golden, colorado' AND "Founded" > '1874' |
User List: Top N - Location/abbreviation. Enter more than one character for location. | CREATE TABLE ReviewRejectionReasons (Id number,Name text,Description text,PostTypeId number)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHostAddress text)CREATE TABLE CloseAsOf... | SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation, Location, LastAccessDate, UpVotes, DownVotes FROM Users WHERE LOWER(Location) LIKE LOWER('%##Location##%') OR Location LIKE UPPER('%##LocAbbreviation##') AND LENGTH(Location) > 1 LIMIT 100 |
how many patients have received a blood, venipuncture test this year? | 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 COUNT(DISTINCT patient.uniquepid) FROM patient WHERE patient.patientunitstayid IN (SELECT microlab.patientunitstayid FROM microlab WHERE microlab.culturesite = 'blood, venipuncture' AND DATETIME(microlab.culturetakentime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')) |
Name the manager for playoffs of missed for 1999 | CREATE TABLE table_name_45 (manager VARCHAR,playoffs VARCHAR,year VARCHAR) | SELECT manager FROM table_name_45 WHERE playoffs = "missed" AND year = "1999" |
What is the Pinyin transcription for 'Alas for the Days Gone By'? | CREATE TABLE table_22133 ("Standard order" real,"English translation" text,"Transcription (based on Pinyin)" text,"Traditional Chinese" text,"Simplified Chinese" text) | SELECT "Transcription (based on Pinyin)" FROM table_22133 WHERE "English translation" = 'Alas for the Days Gone By' |
what is the highest attendance for week 6? | CREATE TABLE table_13492 ("Week" real,"Date" text,"Opponent" text,"Result" text,"Attendance" real) | SELECT MAX("Attendance") FROM table_13492 WHERE "Week" = '6' |
Show the names of people who have been on the negative side of debates at least twice. | CREATE TABLE people (people_id number,district text,name text,party text,age number)CREATE TABLE debate_people (debate_id number,affirmative number,negative number,if_affirmative_win others)CREATE TABLE debate (debate_id number,date text,venue text,num_of_audience number) | SELECT T2.name FROM debate_people AS T1 JOIN people AS T2 ON T1.negative = T2.people_id GROUP BY T2.name HAVING COUNT(*) >= 2 |
Get me the list of patients taking succinylcholine who had elective hospital admission. | CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_flag text,admission_location text,discharge_location text,diagnosis text,dod text,dob_year text,dod_year ... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_type = "ELECTIVE" AND prescriptions.drug = "Succinylcholine" |
What is the number drawn when the try BP is 1? | CREATE TABLE table_name_79 (drawn VARCHAR,try_bp VARCHAR) | SELECT drawn FROM table_name_79 WHERE try_bp = "1" |
What date got 9.82 million viewers? | CREATE TABLE table_16882 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Featured character(s)" text,"Original air date" text,"U.S. viewers (million)" text) | SELECT "Original air date" FROM table_16882 WHERE "U.S. viewers (million)" = '9.82' |
Which team had fans took of 288? | CREATE TABLE table_67431 ("Team" text,"Miles [One Way]" real,"Home Result" text,"Fans Brought" text,"Away Result" text,"Fans Took" text,"Points Gained" real) | SELECT "Team" FROM table_67431 WHERE "Fans Took" = '288' |
find the number of patients whose language is english and diagnoses is atriovent block complete. | 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 prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd t... | SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.language = "ENGL" AND diagnoses.short_title = "Atriovent block complete" |
For all employees who have the letters D or S in their first name, draw a line chart about the change of employee_id over hire_date , and sort HIRE_DATE in asc 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 regions (REGION_ID decimal(5,0),REGIO... | SELECT HIRE_DATE, EMPLOYEE_ID FROM employees WHERE FIRST_NAME LIKE '%D%' OR FIRST_NAME LIKE '%S%' ORDER BY HIRE_DATE |
What was the result when they had their bye week? | CREATE TABLE table_name_84 (result VARCHAR,date VARCHAR) | SELECT result FROM table_name_84 WHERE date = "bye" |
Home result of 1 0, and a Away result of 0 1 involves what club? | CREATE TABLE table_75505 ("Season" text,"Competition" text,"Round" text,"Club" text,"Home result" text,"Away result" text) | SELECT "Club" FROM table_75505 WHERE "Home result" = '1–0' AND "Away result" = '0–1' |
For MATSCIE 550 , what is the number of sections available that are not before 10 A.M. ? | CREATE TABLE instructor (instructor_id int,name varchar,uniqname 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 int,heavy_assi... | SELECT COUNT(*) FROM course, course_offering, semester WHERE course_offering.start_time > '10:00:00' AND course.course_id = course_offering.course_id AND course.department = 'MATSCIE' AND course.number = 550 AND semester.semester = 'WN' AND semester.semester_id = course_offering.semester AND semester.year = 2016 |
since 2 years ago, how many patients was given venous cath nec two or more times? | CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)CREATE TABLE labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE d_labitems (row_id number,itemid number,label text)CREATE TABLE patients (row_id num... | SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'venous cath nec') AND... |
what is drug name of drug code nalo4i? | 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 procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ... | SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.formulary_drug_cd = "NALO4I" |
how many games took place in ostrava ? | CREATE TABLE table_203_537 (id number,"#" number,"date" text,"venue" text,"opponent" text,"score" text,"result" text,"competition" text) | SELECT COUNT(DISTINCT "date") FROM table_203_537 WHERE "venue" = 'ostrava' |
Which Result has an Opponent of steve walker? | CREATE TABLE table_name_4 (result VARCHAR,opponent VARCHAR) | SELECT result FROM table_name_4 WHERE opponent = "steve walker" |
Who was the opponent on August 30? | CREATE TABLE table_51536 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Record" text) | SELECT "Opponent" FROM table_51536 WHERE "Date" = 'august 30' |
For those records from the products and each product's manufacturer, give me the comparison about the average of code over the name , and group by attribute name, and sort in ascending by the x axis. | 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.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Name ORDER BY T2.Name |
What is Party, when Opinion Research Centre (OPC) is 1.5%? | CREATE TABLE table_name_33 (party VARCHAR,opinion_research_centre__opc_ VARCHAR) | SELECT party FROM table_name_33 WHERE opinion_research_centre__opc_ = "1.5%" |
What is the latest paper by emanuel todorov ? | CREATE TABLE paperkeyphrase (paperid int,keyphraseid int)CREATE TABLE author (authorid int,authorname varchar)CREATE TABLE dataset (datasetid int,datasetname varchar)CREATE TABLE cite (citingpaperid int,citedpaperid int)CREATE TABLE journal (journalid int,journalname varchar)CREATE TABLE venue (venueid int,venuename va... | SELECT DISTINCT writes.paperid FROM author, paper, writes WHERE author.authorname = 'emanuel todorov' AND writes.authorid = author.authorid AND writes.paperid = paper.paperid ORDER BY paper.year DESC |
WHAT WAS THE JERSEY NUMBER OF THE ROSTER PLAYER FROM OKLAHOMA STATE WHO PLAYED GUARD? | CREATE TABLE table_15621965_18 (no VARCHAR,position VARCHAR,school_club_team VARCHAR) | SELECT no FROM table_15621965_18 WHERE position = "Guard" AND school_club_team = "Oklahoma State" |
When racing epsom is in division two how many seasons are there? | CREATE TABLE table_24575253_4 (season VARCHAR,division_two VARCHAR) | SELECT COUNT(season) FROM table_24575253_4 WHERE division_two = "Racing Epsom" |
I want the date for an bal s nchez | CREATE TABLE table_54624 ("Pitcher" text,"Date" text,"Team" text,"Result" text,"Site" text) | SELECT "Date" FROM table_54624 WHERE "Pitcher" = 'aníbal sánchez' |
Show different occupations along with the number of players in each occupation Show bar chart, and show x-axis from high to low order. | CREATE TABLE coach (Coach_ID int,Coach_name text,Gender text,Club_ID int,Rank int)CREATE TABLE player (Player_ID int,Sponsor_name text,Player_name text,Gender text,Residence text,Occupation text,Votes int,Rank text)CREATE TABLE club (Club_ID int,Club_name text,Region text,Start_year int)CREATE TABLE match_result (Rank ... | SELECT Occupation, COUNT(*) FROM player GROUP BY Occupation ORDER BY Occupation DESC |
Which show has a character of Rohan? | CREATE TABLE table_name_89 (show VARCHAR,character VARCHAR) | SELECT show FROM table_name_89 WHERE character = "rohan" |
What is the number of games for the season with 10 ties? | CREATE TABLE table_40756 ("Season" text,"Games" real,"Lost" real,"Tied" real,"Points" real,"Pct %" real,"Goals for" real,"Goals against" real) | SELECT "Games" FROM table_40756 WHERE "Tied" = '10' |
What was the production code of the episode with an audience of 14.79 million in the US? | CREATE TABLE table_29978 ("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 "Production code" FROM table_29978 WHERE "U.S. viewers (million)" = '14.79' |
which route had plain stage terrain and was used on the 27th of june ? | CREATE TABLE table_203_44 (id number,"stage" text,"date" text,"route" text,"terrain" text,"length" text,"winner" text) | SELECT "route" FROM table_203_44 WHERE "terrain" = 'plain stage' AND "date" = '27 june' |
What is the sum of District, when Took Office is greater than 1981, and when Senator is Cyndi Taylor Krier? | CREATE TABLE table_name_67 (district INTEGER,took_office VARCHAR,senator VARCHAR) | SELECT SUM(district) FROM table_name_67 WHERE took_office > 1981 AND senator = "cyndi taylor krier" |
How many years have toyota team tom's as the team, with Laps greater than 64? | CREATE TABLE table_62937 ("Year" real,"Class" text,"Tyres" text,"Team" text,"Co-Drivers" text,"Laps" real,"Pos." text) | SELECT COUNT("Year") FROM table_62937 WHERE "Team" = 'toyota team tom''s' AND "Laps" > '64' |
Name the most game with opponent of hartford whalers | CREATE TABLE table_6228 ("Game" real,"February" real,"Opponent" text,"Score" text,"Record" text) | SELECT MAX("Game") FROM table_6228 WHERE "Opponent" = 'hartford whalers' |
What is the Time with an Away that is broadview hawks? | CREATE TABLE table_40263 ("Date" text,"Time" text,"Home" text,"Away" text,"Score" text,"Ground" text) | SELECT "Time" FROM table_40263 WHERE "Away" = 'broadview hawks' |
What is the mail date of the document with id 7? | CREATE TABLE ref_shipping_agents (shipping_agent_code text,shipping_agent_name text,shipping_agent_description text)CREATE TABLE draft_copies (document_id number,draft_number number,copy_number number)CREATE TABLE circulation_history (document_id number,draft_number number,copy_number number,employee_id number)CREATE T... | SELECT mailing_date FROM documents_mailed WHERE document_id = 7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.