instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Find the names of the top 3 departments that provide the largest amount of courses?
CREATE TABLE prereq (course_id text,prereq_id text)CREATE TABLE student (id text,name text,dept_name text,tot_cred number)CREATE TABLE department (dept_name text,building text,budget number)CREATE TABLE time_slot (time_slot_id text,day text,start_hr number,start_min number,end_hr number,end_min number)CREATE TABLE take...
SELECT dept_name FROM course GROUP BY dept_name ORDER BY COUNT(*) DESC LIMIT 3
what flights from ST. PAUL to KANSAS CITY on friday with supper served
CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flight_number int,from_airport varchar,meal_code text,stops int,time_elapsed int,to_airport varchar)CREATE TABLE flight_stop (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, date_day, days, flight, food_service WHERE ((date_day.day_number = 25 AND date_day.month_number = 6 AND date_day.year = 1991 AND days.day_name = date_day.day_name AND flight....
name the team that finished directly after josiah ng 's .
CREATE TABLE table_204_204 (id number,"rank" number,"heat" number,"country" text,"cyclists" text,"result" number,"notes" text)
SELECT "country" FROM table_204_204 WHERE "rank" = (SELECT "rank" FROM table_204_204 WHERE "cyclists" = 'josiah ng') + 1
Which District has a First elected of 1858, and a Result of retired republican gain, and an Incumbent of william millward?
CREATE TABLE table_name_2 (district VARCHAR,incumbent VARCHAR,first_elected VARCHAR,result VARCHAR)
SELECT district FROM table_name_2 WHERE first_elected = 1858 AND result = "retired republican gain" AND incumbent = "william millward"
Which qualifying schools were in the Patriot conference?
CREATE TABLE table_72770 ("School" text,"Record" text,"Conference" text,"Conf. record" text,"Regular season finish" text,"Regular season second place" text)
SELECT "School" FROM table_72770 WHERE "Conference" = 'Patriot'
417 is taught in the Fall of 2006 in the afternoon ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE gsi (course_offering_id int,student_id int)CREATE TABLE course (course_id int,name varchar,department varchar,numbe...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.start_time >= '12:00:00' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND course.number = 417 AND semester.semester = 'Fall' AND semester.semester_id = course_offering.semester AND semester.year = 2006
what is the date when ramon sessions (8) had the high assists, richard jefferson (29) had the high points and the score was w 107 78 (ot)?
CREATE TABLE table_name_32 (date VARCHAR,score VARCHAR,high_assists VARCHAR,high_points VARCHAR)
SELECT date FROM table_name_32 WHERE high_assists = "ramon sessions (8)" AND high_points = "richard jefferson (29)" AND score = "w 107–78 (ot)"
Which Date has a Home of minnesota?
CREATE TABLE table_33911 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Decision" text,"Attendance" real,"Record" text)
SELECT "Date" FROM table_33911 WHERE "Home" = 'minnesota'
When did the episode with production code 410 air?
CREATE TABLE table_274 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT "Original air date" FROM table_274 WHERE "Production code" = '410'
did the anaheim storm win more home or away games ?
CREATE TABLE table_203_118 (id number,"game" number,"date" text,"opponent" text,"location" text,"score" text,"ot" text,"attendance" number,"record" text)
SELECT (SELECT COUNT(*) FROM table_203_118 WHERE "opponent" = 'home' AND "score" = 'w') > (SELECT COUNT(*) FROM table_203_118 WHERE "opponent" = 'away' AND "score" = 'w')
Which Country has a Score of 69-66=135?
CREATE TABLE table_name_76 (country VARCHAR,score VARCHAR)
SELECT country FROM table_name_76 WHERE score = 69 - 66 = 135
count the number of patients whose age is less than 55 and days of hospital stay is greater than 4?
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 WHERE demographic.age < "55" AND demographic.days_stay > "4"
What in the minimum number of championships won by a nation?
CREATE TABLE table_19487922_2 (championships INTEGER)
SELECT MIN(championships) FROM table_19487922_2
What is dardanus sulcus' lowest diameter?
CREATE TABLE table_name_7 (diameter INTEGER,name VARCHAR)
SELECT MIN(diameter) FROM table_name_7 WHERE name = "dardanus sulcus"
How many appearances with fc igea virtus and 1 goal?
CREATE TABLE table_11006 ("Country" text,"Season" text,"Club" text,"League" text,"Appearances" real,"Goals" real)
SELECT AVG("Appearances") FROM table_11006 WHERE "Club" = 'fc igea virtus' AND "Goals" = '1'
For those employees who do not work in departments with managers that have ids between 100 and 200, show me about the distribution of hire_date and the sum of salary bin hire_date by time in a bar chart, I want to order by the y-axis in descending.
CREATE TABLE job_history (EMPLOYEE_ID decimal(6,0),START_DATE date,END_DATE date,JOB_ID varchar(10),DEPARTMENT_ID decimal(4,0))CREATE TABLE countries (COUNTRY_ID varchar(2),COUNTRY_NAME varchar(40),REGION_ID decimal(10,0))CREATE TABLE locations (LOCATION_ID decimal(4,0),STREET_ADDRESS varchar(40),POSTAL_CODE varchar(12...
SELECT HIRE_DATE, SUM(SALARY) FROM employees WHERE NOT DEPARTMENT_ID IN (SELECT DEPARTMENT_ID FROM departments WHERE MANAGER_ID BETWEEN 100 AND 200) ORDER BY SUM(SALARY) DESC
Total votes on you by type of vote and type of post.
CREATE TABLE CloseReasonTypes (Id number,Name text,Description text)CREATE TABLE PostHistory (Id number,PostHistoryTypeId number,PostId number,RevisionGUID other,CreationDate time,UserId number,UserDisplayName text,Comment text,Text text,ContentLicense text)CREATE TABLE PostTags (PostId number,TagId number)CREATE TABLE...
SELECT '##UserId##' AS "user_link", votetype.Name AS type, post.PostTypeId AS posttype, COUNT(*) AS count FROM VoteTypes AS votetype INNER JOIN Votes AS vote ON vote.VoteTypeId = votetype.Id INNER JOIN Posts AS post ON vote.PostId = post.Id AND post.OwnerUserId = '##UserId##' GROUP BY votetype.Name, post.PostTypeId
For each bed type, find the average base price of different bed type Show bar chart, display in asc by the y axis.
CREATE TABLE Reservations (Code INTEGER,Room TEXT,CheckIn TEXT,CheckOut TEXT,Rate REAL,LastName TEXT,FirstName TEXT,Adults INTEGER,Kids INTEGER)CREATE TABLE Rooms (RoomId TEXT,roomName TEXT,beds INTEGER,bedType TEXT,maxOccupancy INTEGER,basePrice INTEGER,decor TEXT)
SELECT bedType, AVG(basePrice) FROM Rooms GROUP BY bedType ORDER BY AVG(basePrice)
when was the last time that patient 23237 was measured / taken a measurement of arterial bp [systolic] since 337 days ago?
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 labevents (row_id number,subject_id number,hadm_id number,itemid number,charttime time,valuenum number,valueuom text)CREATE TABLE patients (row_id number,sub...
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 = 23237)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial...
tell me the first value of creatinine in a lab test of patient 016-22566 during this month?
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 lab.labresult FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '016-22566')) AND lab.labname = 'creatinine' AND DATETIME(lab.labresulttime, 'start of m...
When did Mathieu play against Andrey Golubev?
CREATE TABLE table_name_7 (date VARCHAR,opponent_in_the_final VARCHAR)
SELECT date FROM table_name_7 WHERE opponent_in_the_final = "andrey golubev"
What is Madeleine Dupont's shot pct.?
CREATE TABLE table_40162 ("Locale" text,"Skip" text,"Ends Won" real,"Ends Lost" real,"Blank Ends" real,"Stolen Ends" real,"Shot Pct." text)
SELECT "Shot Pct." FROM table_40162 WHERE "Skip" = 'madeleine dupont'
What was being played on Nov 23, 2006?
CREATE TABLE table_name_79 (competition VARCHAR,date VARCHAR)
SELECT competition FROM table_name_79 WHERE date = "nov 23, 2006"
Rich round has an H/A of A and the opponent Sheffield United?
CREATE TABLE table_name_83 (round VARCHAR,h___a VARCHAR,opponents VARCHAR)
SELECT round FROM table_name_83 WHERE h___a = "a" AND opponents = "sheffield united"
when was patient 14054 last sputum microbiologic test during the last month?
CREATE TABLE transfers (row_id number,subject_id number,hadm_id number,icustay_id number,eventtype text,careunit text,wardid number,intime time,outtime time)CREATE TABLE diagnoses_icd (row_id number,subject_id number,hadm_id number,icd9_code text,charttime time)CREATE TABLE chartevents (row_id number,subject_id number,...
SELECT microbiologyevents.charttime FROM microbiologyevents WHERE microbiologyevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14054) AND microbiologyevents.spec_type_desc = 'sputum' AND DATETIME(microbiologyevents.charttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start ...
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of name and price , and group by attribute name, and show Y in asc order.
CREATE TABLE Products (Code INTEGER,Name VARCHAR(255),Price DECIMAL,Manufacturer INTEGER)CREATE TABLE Manufacturers (Code INTEGER,Name VARCHAR(255),Headquarter VARCHAR(255),Founder VARCHAR(255),Revenue REAL)
SELECT T1.Name, T1.Price FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Price
what 's the airport at ORLANDO
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 food_service (meal_code text,meal_number int,compartment text,meal_description varchar)CREATE TABLE date_day (month_number int,day_numbe...
SELECT DISTINCT airport.airport_code FROM airport, airport_service, city WHERE airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ORLANDO'
What was the highest number of goals when 2428 minutes were played?
CREATE TABLE table_40238 ("Player" text,"Position" text,"GP (GS)" text,"Minutes" real,"Goals" real,"Assists" real)
SELECT MAX("Goals") FROM table_40238 WHERE "Minutes" = '2428'
What is the average birth rate that has a total fertility rate of na, and a natural growth smaller than 2.5?
CREATE TABLE table_name_14 (births__000s_ INTEGER,total_fertility_rate VARCHAR,natural_growth VARCHAR)
SELECT AVG(births__000s_) FROM table_name_14 WHERE total_fertility_rate = "na" AND natural_growth < 2.5
How many viewers in millions for episode number 38?
CREATE TABLE table_2602958_3 (us_viewers__million_ VARCHAR,no VARCHAR)
SELECT us_viewers__million_ FROM table_2602958_3 WHERE no = 38
How many wins were there for Washington State College with losses greater than 980 and a first season before 1906 and rank greater than 42?
CREATE TABLE table_name_29 (wins VARCHAR,rank VARCHAR,college VARCHAR,losses VARCHAR,first_season VARCHAR)
SELECT COUNT(wins) FROM table_name_29 WHERE losses > 980 AND first_season < 1906 AND college = "washington state" AND rank > 42
What was the state that had the vassal name of li?
CREATE TABLE table_50243 ("State" text,"Type" text,"Name" text,"Title" text,"Royal house" text)
SELECT "State" FROM table_50243 WHERE "Name" = 'li'
what is the name of the organism found in patient 025-44495's first sputum, tracheal specimen microbiological test this month?
CREATE TABLE treatment (treatmentid number,patientunitstayid number,treatmentname text,treatmenttime time)CREATE TABLE intakeoutput (intakeoutputid number,patientunitstayid number,cellpath text,celllabel text,cellvaluenumeric number,intakeoutputtime time)CREATE TABLE lab (labid number,patientunitstayid number,labname t...
SELECT microlab.organism FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '025-44495')) AND microlab.culturesite = 'sputum, tracheal specimen' AND D...
What type of format was released after 1979?
CREATE TABLE table_52196 ("Release format" text,"Country" text,"Label" text,"Cat. No." text,"Release date" real)
SELECT "Release format" FROM table_52196 WHERE "Release date" > '1979'
What league is from the United States and a round smaller than 12.
CREATE TABLE table_5638 ("Round" real,"Player" text,"Position" text,"Nationality" text,"College/Junior/Club Team (League)" text)
SELECT "College/Junior/Club Team (League)" FROM table_5638 WHERE "Nationality" = 'united states' AND "Round" < '12'
What is the name of the film with an award of 5,380?
CREATE TABLE table_15670 ("Film" text,"Director(s)" text,"Producer(s)" text,"Recipient" text,"Date" text,"Award" text)
SELECT "Film" FROM table_15670 WHERE "Award" = '£5,380'
What are the number of the countries of all airlines whose names start with Orbit?, I want to list by the y axis in asc.
CREATE TABLE airports (apid integer,name text,city text,country text,x real,y real,elevation bigint,iata character varchar(3),icao character varchar(4))CREATE TABLE routes (rid integer,dst_apid integer,dst_ap varchar(4),src_apid bigint,src_ap varchar(4),alid bigint,airline varchar(4),codeshare text)CREATE TABLE airline...
SELECT country, COUNT(country) FROM airlines WHERE name LIKE 'Orbit%' GROUP BY country ORDER BY COUNT(country)
What was the score with a goal of 16?
CREATE TABLE table_name_93 (score VARCHAR,goal VARCHAR)
SELECT score FROM table_name_93 WHERE goal = 16
what was natalia 's top single on the polish charts ?
CREATE TABLE table_204_365 (id number,"year" number,"single" text,"chart positions\nusa billboard hot dance club play" number,"chart positions\npolish charts" number,"album" text)
SELECT "single" FROM table_204_365 ORDER BY "chart positions\npolish charts" LIMIT 1
What is the fewest number of top-25s for events with more than 13 cuts made?
CREATE TABLE table_79680 ("Tournament" text,"Wins" real,"Top-5" real,"Top-25" real,"Events" real,"Cuts made" real)
SELECT MIN("Top-25") FROM table_79680 WHERE "Cuts made" > '13'
Find the invoice numbers which are created before 1989-09-03 or after 2007-12-25.
CREATE TABLE invoices (invoice_number VARCHAR,invoice_date VARCHAR)
SELECT invoice_number FROM invoices WHERE invoice_date < "1989-09-03" OR invoice_date > "2007-12-25"
What is the Martin McGuinness with a David Norris that is 10.3%?
CREATE TABLE table_name_16 (martin_mcguinness VARCHAR,david_norris VARCHAR)
SELECT martin_mcguinness FROM table_name_16 WHERE david_norris = "10.3%"
Find the total number of students in each department Show bar chart, and I want to show by the X-axis from low to high.
CREATE TABLE teaches (ID varchar(5),course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0))CREATE TABLE department (dept_name varchar(20),building varchar(15),budget numeric(12,2))CREATE TABLE section (course_id varchar(8),sec_id varchar(8),semester varchar(6),year numeric(4,0),building varchar(15...
SELECT dept_name, COUNT(*) FROM student GROUP BY dept_name ORDER BY dept_name
how many patients were diagnosed with ami inferior wall, init and they didn't come back to the hospital within 2 months in this year?
CREATE TABLE d_icd_procedures (row_id number,icd9_code text,short_title text,long_title text)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,end...
SELECT (SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd JOIN admissions ON diagnoses_icd.hadm_id = admissions.hadm_id WHERE diagnoses_icd.icd9_code = (SELECT d_icd_diagnoses.icd9_code FROM d_icd_diagnoses WHERE d_icd_diagnoses.short_title = 'ami inferi...
Tell me the number of emergency hospital admission patients who had a renal epithelial cells lab test.
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 procedures (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND lab.label = "Renal Epithelial Cells"
What venue had gross revenues of $1,325,153 in 2011?
CREATE TABLE table_69201 ("Venue" text,"City" text,"Tickets Sold / Available" text,"Gross Revenue (1982)" text,"Gross Revenue (2011)" text)
SELECT "Venue" FROM table_69201 WHERE "Gross Revenue (2011)" = '$1,325,153'
, 2^n.
CREATE TABLE CloseAsOffTopicReasonTypes (Id number,IsUniversal boolean,InputTitle text,MarkdownInputGuidance text,MarkdownPostOwnerGuidance text,MarkdownPrivilegedUserGuidance text,MarkdownConcensusDescription text,CreationDate time,CreationModeratorId number,ApprovalDate time,ApprovalModeratorId number,DeactivationDat...
SELECT MIN(Posts) AS "min_posts", NULL AS "min_questions", COUNT(OwnerUserId) AS Users FROM (SELECT COUNT(*) AS Posts, OwnerUserId FROM Posts GROUP BY OwnerUserId) AS pu GROUP BY FLOOR(LN(Posts) / LN(2)) UNION SELECT NULL AS "min_posts", MIN(Questions) AS "min_questions", COUNT(OwnerUserId) AS Users FROM (SELECT COUNT(...
give me the latest flight tomorrow on UA from MILWAUKEE to TACOMA
CREATE TABLE time_interval (period text,begin_time int,end_time int)CREATE TABLE compartment_class (compartment varchar,class_type varchar)CREATE TABLE state (state_code text,state_name text,country_name text)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,conn...
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 = 'TACOMA' AND date_day.day_number = 20 AND date_day.month_number = 1 AND ...
What are the number of dates of birth of all the guests whose gender is 'Male'?
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 Apartment_Bookings (apt_booking_id INTEGER,apt_id INTEGER,gues...
SELECT date_of_birth, COUNT(date_of_birth) FROM Guests WHERE gender_code = "Male"
how many patients whose primary disease is hyperglycemia and age is less than 56?
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 text,route text,drug_dose text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "HYPERGLYCEMIA" AND demographic.age < "56"
List the number of episodes directed by linda mendoza.
CREATE TABLE table_25548213_1 (production_code VARCHAR,directed_by VARCHAR)
SELECT COUNT(production_code) FROM table_25548213_1 WHERE directed_by = "Linda Mendoza"
What was Gary Megson's manner of departure?
CREATE TABLE table_19359427_6 (manner_of_departure VARCHAR,outgoing_manager VARCHAR)
SELECT manner_of_departure FROM table_19359427_6 WHERE outgoing_manager = "Gary Megson"
Who was the opponent at the game that had a loss of Hendrickson (0-1)?
CREATE TABLE table_name_93 (opponent VARCHAR,loss VARCHAR)
SELECT opponent FROM table_name_93 WHERE loss = "hendrickson (0-1)"
What upper-level classes have 4 credits ?
CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE course_prerequisite (pre_course_id int,course_id int)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE program_requirement (program_id int,category varc...
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 4 AND program_course.category LIKE 'ULCS'
How many placed 4th on April 25?
CREATE TABLE table_22951 ("Round" real,"Date" text,"City and venue" text,"Winner" text,"Runner-up" text,"3rd placed" text,"4th placed" text,"Results" text)
SELECT COUNT("4th placed") FROM table_22951 WHERE "Date" = 'April 25'
Name the time with track number less than 4 for you're my everything
CREATE TABLE table_34074 ("Track number" real,"Song title" text,"Songwriter(s)" text,"Orchestra" text,"Time" text)
SELECT "Time" FROM table_34074 WHERE "Track number" < '4' AND "Song title" = 'you''re my everything'
Which area do most of the crimes happen?
CREATE TABLE greatermanchestercrime (crimeid text,crimets time,location text,lsoa text,type text,outcome text)
SELECT location FROM greatermanchestercrime GROUP BY location ORDER BY COUNT(*) DESC LIMIT 1
What was the finish of the Kentucky Derby?
CREATE TABLE table_46437 ("Finish" text,"Race" text,"Distance" text,"Jockey" text,"Time" text,"Victory Margin (in lengths)" text,"Runner up" text,"Track" text,"Surface" text,"Date" text)
SELECT "Finish" FROM table_46437 WHERE "Race" = 'kentucky derby'
What is the total 2008 value with a 2006 value greater than 322.7, a 353.9 in 2011, and a 2009 less than 392?
CREATE TABLE table_name_53 (Id VARCHAR)
SELECT COUNT(2008) FROM table_name_53 WHERE 2006 > 322.7 AND 2011 = 353.9 AND 2009 < 392
Who is the visitor from the game with 7,000 in attendance on January 1?
CREATE TABLE table_name_77 (visitor VARCHAR,attendance VARCHAR,date VARCHAR)
SELECT visitor FROM table_name_77 WHERE attendance = "7,000" AND date = "january 1"
On Mondays and Wednesday , is it possible for me to take 567 ?
CREATE TABLE ta (campus_job_id int,student_id int,location varchar)CREATE TABLE comment_instructor (instructor_id int,student_id int,score int,comment_text varchar)CREATE TABLE offering_instructor (offering_instructor_id int,offering_id int,instructor_id int)CREATE TABLE semester (semester_id int,semester varchar,year ...
SELECT COUNT(*) > 0 FROM course, course_offering, semester WHERE course_offering.friday = 'N' AND course_offering.monday = 'Y' AND course_offering.thursday = 'N' AND course_offering.tuesday = 'N' AND course_offering.wednesday = 'Y' AND course.course_id = course_offering.course_id AND course.department = 'EECS' AND cour...
Guessing at recent favorited tags given a user ID based on activity..
CREATE TABLE PostsWithDeleted (Id number,PostTypeId number,AcceptedAnswerId number,ParentId number,CreationDate time,DeletionDate time,Score number,ViewCount number,Body text,OwnerUserId number,OwnerDisplayName text,LastEditorUserId number,LastEditorDisplayName text,LastEditDate time,LastActivityDate time,Title text,Ta...
SELECT TagName, COUNT(*) AS UpVotes FROM Tags INNER JOIN PostTags ON PostTags.TagId = Tags.Id INNER JOIN Posts ON Posts.ParentId = PostTags.PostId INNER JOIN Votes ON Votes.PostId = Posts.Id AND VoteTypeId = 2 WHERE Posts.OwnerUserId = @UserId GROUP BY TagName ORDER BY UpVotes DESC LIMIT 5
What game had the result of 112-100?
CREATE TABLE table_name_98 (game VARCHAR,result VARCHAR)
SELECT game FROM table_name_98 WHERE result = "112-100"
when has patient 031-4423 had a microbiology test for the last time in 07/2104?
CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime time,icd9code text)CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature ...
SELECT microlab.culturetakentime FROM microlab WHERE microlab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '031-4423')) AND STRFTIME('%y-%m', microlab.culturetakentime) = '2...
Who is the Driver, when the Engine is Chevrolet, and when the Date is October 3?
CREATE TABLE table_name_90 (driver VARCHAR,engine VARCHAR,date VARCHAR)
SELECT driver FROM table_name_90 WHERE engine = "chevrolet" AND date = "october 3"
What is the most effective determinative method in terms of pesticide residues detection?
CREATE TABLE resultsdata15 (sample_pk number,commod text,commtype text,lab text,pestcode text,testclass text,concen number,lod number,conunit text,confmethod text,confmethod2 text,annotate text,quantitate text,mean text,extract text,determin text)CREATE TABLE sampledata15 (sample_pk number,state text,year text,month te...
SELECT determin FROM resultsdata15 GROUP BY determin ORDER BY COUNT(*) DESC LIMIT 1
Who had the most rebounds and how many did they have on October 16?
CREATE TABLE table_74176 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Record" text)
SELECT "High rebounds" FROM table_74176 WHERE "Date" = 'October 16'
What is the league of player ian schultz?
CREATE TABLE table_45620 ("Round" text,"Pick" real,"Player" text,"Position" text,"Shoots" text,"Nationality" text,"League" text,"Birthplace,Date" text,"Height,Weight" text)
SELECT "League" FROM table_45620 WHERE "Player" = 'ian schultz'
What is the highest Drawn when the lost is 7 and the points are more than 4, and the against is less than 22?
CREATE TABLE table_75774 ("Position" real,"Team" text,"Points" real,"Played" real,"Drawn" real,"Lost" real,"Against" real,"Difference" text)
SELECT MAX("Drawn") FROM table_75774 WHERE "Lost" = '7' AND "Points" > '4' AND "Against" < '22'
On what Surface was the match against Ilija Bozoljac played?
CREATE TABLE table_49186 ("Date" text,"Tournament" text,"Surface" text,"Opponent" text,"Score" text)
SELECT "Surface" FROM table_49186 WHERE "Opponent" = 'ilija bozoljac'
how many maximum # when viewers (m) is 8.01
CREATE TABLE table_27374740_2 (_number INTEGER,viewers__m_ VARCHAR)
SELECT MAX(_number) FROM table_27374740_2 WHERE viewers__m_ = "8.01"
Which Round has a College of stanford, and an Overall smaller than 8?
CREATE TABLE table_name_57 (round INTEGER,college VARCHAR,overall VARCHAR)
SELECT AVG(round) FROM table_name_57 WHERE college = "stanford" AND overall < 8
How many credits does the department offer Show bar chart, I want to order from low to high by the bars.
CREATE TABLE DEPARTMENT (DEPT_CODE varchar(10),DEPT_NAME varchar(30),SCHOOL_CODE varchar(8),EMP_NUM int,DEPT_ADDRESS varchar(20),DEPT_EXTENSION varchar(4))CREATE TABLE ENROLL (CLASS_CODE varchar(5),STU_NUM int,ENROLL_GRADE varchar(50))CREATE TABLE CLASS (CLASS_CODE varchar(5),CRS_CODE varchar(10),CLASS_SECTION varchar(...
SELECT DEPT_CODE, SUM(CRS_CREDIT) FROM COURSE GROUP BY DEPT_CODE ORDER BY DEPT_CODE
What was being played on Nov 23, 2006?
CREATE TABLE table_58276 ("Competition" text,"Stage" text,"Venue" text,"Date" text,"Result" text)
SELECT "Competition" FROM table_58276 WHERE "Date" = 'nov 23, 2006'
Cowansville has less than 16 regions and is a Brome-Missisquoi Municipality, what is their population?
CREATE TABLE table_78142 ("Code" real,"Type" text,"Name" text,"Area (km 2)" real,"Population" real,"Regional County Municipality" text,"Region" real)
SELECT MIN("Population") FROM table_78142 WHERE "Regional County Municipality" = 'brome-missisquoi' AND "Name" = 'cowansville' AND "Region" < '16'
What is the sum of silver medals of the nation Cuba, which has less than 0 gold?
CREATE TABLE table_7155 ("Rank" text,"Nation" text,"Gold" real,"Silver" real,"Bronze" real,"Total" real)
SELECT SUM("Silver") FROM table_7155 WHERE "Nation" = 'cuba' AND "Gold" < '0'
Name the outcome that had an opponent in final of nina bratchikova kathrin w rle
CREATE TABLE table_name_56 (outcome VARCHAR,opponent_in_final VARCHAR)
SELECT outcome FROM table_name_56 WHERE opponent_in_final = "nina bratchikova kathrin wörle"
What is the Region, when the Catalog is 25AP 301?
CREATE TABLE table_name_61 (region VARCHAR,catalog VARCHAR)
SELECT region FROM table_name_61 WHERE catalog = "25ap 301"
When was the start of the construction of the unit that's been in commercial operation since 04.03.1987?
CREATE TABLE table_12983929_1 (construction_start VARCHAR,commercial_operation VARCHAR)
SELECT construction_start FROM table_12983929_1 WHERE commercial_operation = "04.03.1987"
What is the lowest number of olives of the governorate with less than 247,265 industrial crops and more than 37,638 cereals?
CREATE TABLE table_12849 ("Governorate" text,"Cereals" real,"Fruit Trees" real,"Olives" real,"Industrial crops" real,"Vegetables" real)
SELECT MIN("Olives") FROM table_12849 WHERE "Industrial crops" < '247,265' AND "Cereals" > '37,638'
who is the Visitor that has a Series of series tied 2 2?
CREATE TABLE table_name_33 (visitor VARCHAR,series VARCHAR)
SELECT visitor FROM table_name_33 WHERE series = "series tied 2–2"
What tournament did Smeets play against Mark nielsen?
CREATE TABLE table_name_11 (tournament VARCHAR,opponent_in_the_final VARCHAR)
SELECT tournament FROM table_name_11 WHERE opponent_in_the_final = "mark nielsen"
which runners ran above 95.4 ?
CREATE TABLE table_204_296 (id number,"rank" number,"athlete" text,"qual" number,"final" number,"total" number,"notes" text)
SELECT "athlete" FROM table_204_296 WHERE "final" > 95.4
find the numner of female patients whose procedure icd9 code is 12.
CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay text,insurance text,ethnicity text,expire_fla...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "F" AND procedures.icd9_code = "12"
Provide me the list of male patients with aortic insufficiency/re-do sternotomy with aortic valve replacement as the primary disease.
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,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id t...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.gender = "M" AND demographic.diagnosis = "AORTIC INSUFFICIENCY\RE-DO STERNOTOMY; AORTIC VALVE REPLACEMENT "
Which method has the record of 11-1?
CREATE TABLE table_name_4 (method VARCHAR,record VARCHAR)
SELECT method FROM table_name_4 WHERE record = "11-1"
since 1804 days ago, had patient 007-16517 excreted any urine count?
CREATE TABLE vitalperiodic (vitalperiodicid number,patientunitstayid number,temperature number,sao2 number,heartrate number,respiration number,systemicsystolic number,systemicdiastolic number,systemicmean number,observationtime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyna...
SELECT COUNT(*) > 0 FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '007-16517')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutpu...
What is the broadcast date when 8.3 million viewers watched?
CREATE TABLE table_21974 ("Episode" text,"Broadcast date" text,"Run time" text,"Viewers (in millions)" text,"Archive" text)
SELECT "Broadcast date" FROM table_21974 WHERE "Viewers (in millions)" = '8.3'
count the number of patients whose marital status is widowed and item id is 50924?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.marital_status = "WIDOWED" AND lab.itemid = "50924"
What is Opponent, when Result is Loss, and when Venue is Mosaic Stadium?
CREATE TABLE table_name_17 (opponent VARCHAR,result VARCHAR,venue VARCHAR)
SELECT opponent FROM table_name_17 WHERE result = "loss" AND venue = "mosaic stadium"
Record of 9 1 had what game site?
CREATE TABLE table_name_70 (game_site VARCHAR,record VARCHAR)
SELECT game_site FROM table_name_70 WHERE record = "9–1"
give me the number of patients whose year of death is less than or equal to 2174 and diagnoses icd9 code is 2984?
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.dod_year <= "2174.0" AND diagnoses.icd9_code = "2984"
What was the series record at after game 3?
CREATE TABLE table_3831 ("Game" real,"Date" text,"Team" text,"Score" text,"High points" text,"High rebounds" text,"High assists" text,"Location Attendance" text,"Series" text)
SELECT "Series" FROM table_3831 WHERE "Game" = '3'
What is every team with location attendance of Philips Arena 12,140?
CREATE TABLE table_27734577_7 (team VARCHAR,location_attendance VARCHAR)
SELECT team FROM table_27734577_7 WHERE location_attendance = "Philips Arena 12,140"
Which Time has a Grid of 19?
CREATE TABLE table_38197 ("Team" text,"Driver" text,"Laps" real,"Time" text,"Grid" real)
SELECT "Time" FROM table_38197 WHERE "Grid" = '19'
Bar graph to show the total number from different allergytype, and show from low to high by the x axis.
CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY AllergyType
What Loss had an Attendance of 17,675?
CREATE TABLE table_15815 ("Date" text,"Opponent" text,"Score" text,"Loss" text,"Attendance" text)
SELECT "Loss" FROM table_15815 WHERE "Attendance" = '17,675'
how long does it take to get from ATL airport into the city of ATLANTA
CREATE TABLE airport_service (city_code varchar,airport_code varchar,miles_distant int,direction varchar,minutes_distant int)CREATE TABLE flight (aircraft_code_sequence text,airline_code varchar,airline_flight text,arrival_time int,connections int,departure_time int,dual_carrier text,flight_days text,flight_id int,flig...
SELECT DISTINCT airport_service.minutes_distant FROM airport, airport_service, city WHERE airport.airport_code = 'ATL' AND airport.airport_code = airport_service.airport_code AND city.city_code = airport_service.city_code AND city.city_name = 'ATLANTA'
Where did Hawthorn play as the home team?
CREATE TABLE table_33174 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_33174 WHERE "Home team" = 'hawthorn'
What is the number of the crowd for the home team of South Melbourne?
CREATE TABLE table_33026 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT SUM("Crowd") FROM table_33026 WHERE "Home team" = 'south melbourne'