instruction
stringlengths
0
1.06k
input
stringlengths
11
5.3k
response
stringlengths
2
4.44k
Find the id and forenames of drivers who participated both the races with name Australian Grand Prix and the races with name Chinese Grand Prix?
CREATE TABLE qualifying (qualifyid number,raceid number,driverid number,constructorid number,number number,position number,q1 text,q2 text,q3 text)CREATE TABLE races (raceid number,year number,round number,circuitid number,name text,date text,time text,url text)CREATE TABLE driverstandings (driverstandingsid number,rac...
SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = T3.driverid WHERE T1.name = "Australian Grand Prix" INTERSECT SELECT T2.driverid, T3.forename FROM races AS T1 JOIN results AS T2 ON T1.raceid = T2.raceid JOIN drivers AS T3 ON T2.driverid = ...
How many players played each position?
CREATE TABLE team (team_id number,name text)CREATE TABLE country (country_id number,country_name text,capital text,official_native_language text)CREATE TABLE player (player_id number,player text,years_played text,total_wl text,singles_wl text,doubles_wl text,team number)CREATE TABLE match_season (season number,player t...
SELECT position, COUNT(*) FROM match_season GROUP BY position
ratio of 15:14, and a just (cents) larger than 119.44 is what average size (cents)?
CREATE TABLE table_34253 ("interval name" text,"size (steps)" real,"size (cents)" real,"just ratio" text,"just (cents)" real,"error" text)
SELECT AVG("size (cents)") FROM table_34253 WHERE "just ratio" = '15:14' AND "just (cents)" > '119.44'
List the names and locations of all stations ordered by their yearly entry exit and interchange amounts.
CREATE TABLE train_station (train_id number,station_id number)CREATE TABLE station (station_id number,name text,annual_entry_exit number,annual_interchanges number,total_passengers number,location text,main_services text,number_of_platforms number)CREATE TABLE train (train_id number,name text,time text,service text)
SELECT name, location FROM station ORDER BY annual_entry_exit, annual_interchanges
how many patients diagnosed with enthesopathy of hip are ethnically black/african american?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug tex...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.ethnicity = "BLACK/AFRICAN AMERICAN" AND diagnoses.short_title = "Enthesopathy of hip"
Find the number of the name of the project for which a scientist whose name contains Smith is assigned to, and rank by the how many name in ascending please.
CREATE TABLE Projects (Code Char(4),Name Char(50),Hours int)CREATE TABLE Scientists (SSN int,Name Char(30))CREATE TABLE AssignedTo (Scientist int,Project char(4))
SELECT T2.Name, COUNT(T2.Name) FROM AssignedTo AS T1 JOIN Projects AS T2 ON T1.Project = T2.Code JOIN Scientists AS T3 ON T1.Scientist = T3.SSN WHERE T3.Name LIKE '%Smith%' GROUP BY T2.Name ORDER BY COUNT(T2.Name)
What Coding has a 3 UTR sequence of 6a 4 with a GenBank id of hq021439?
CREATE TABLE table_5218 ("Variant id" text,"5\u2019UTR splice" text,"Coding" text,"3\u2019UTR sequence" text,"GenBank id" text)
SELECT "Coding" FROM table_5218 WHERE "3\u2019UTR sequence" = '6a 4' AND "GenBank id" = 'hq021439'
Return a bar chart about the distribution of ACC_Road and the amount of ACC_Road , and group by attribute ACC_Road, and display from high to low by the ACC_Road.
CREATE TABLE basketball_match (Team_ID int,School_ID int,Team_Name text,ACC_Regular_Season text,ACC_Percent text,ACC_Home text,ACC_Road text,All_Games text,All_Games_Percent int,All_Home text,All_Road text,All_Neutral text)CREATE TABLE university (School_ID int,School text,Location text,Founded real,Affiliation text,En...
SELECT ACC_Road, COUNT(ACC_Road) FROM basketball_match GROUP BY ACC_Road ORDER BY ACC_Road DESC
What is College/Team, when Round is less than 2, and when Nationality is 'United States'?
CREATE TABLE table_44886 ("Round" real,"Pick" real,"Position" text,"Nationality" text,"College/Team" text)
SELECT "College/Team" FROM table_44886 WHERE "Round" < '2' AND "Nationality" = 'united states'
how tall is patient 009-10951 based on the last measurement during this month?
CREATE TABLE lab (labid number,patientunitstayid number,labname text,labresult number,labresulttime time)CREATE TABLE allergy (allergyid number,patientunitstayid number,drugname text,allergyname text,allergytime time)CREATE TABLE diagnosis (diagnosisid number,patientunitstayid number,diagnosisname text,diagnosistime ti...
SELECT patient.admissionheight FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '009-10951') AND NOT patient.admissionheight IS NULL AND DATETIME(patient.unitadmittime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', ...
Can you tell me the Class (old) to 1868 that has the Quantity larger than 8?
CREATE TABLE table_name_47 (class__old__to_1868 VARCHAR,quantity INTEGER)
SELECT class__old__to_1868 FROM table_name_47 WHERE quantity > 8
What date was Wet Hare, directed by Robert McKimson, released?
CREATE TABLE table_79520 ("Title" text,"Series" text,"Director" text,"Production Number" real,"Release date" text)
SELECT "Release date" FROM table_79520 WHERE "Director" = 'robert mckimson' AND "Title" = 'wet hare'
A bar chart about what are the number of rooms for each bed type?, could you sort in descending by the x-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, COUNT(*) FROM Rooms GROUP BY bedType ORDER BY bedType DESC
What's Doug Borden's position?
CREATE TABLE table_26201 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"School" text)
SELECT "Position" FROM table_26201 WHERE "Player" = 'Doug Borden'
What is the total number of Against that were played in the H Venue on 26 february 1949?
CREATE TABLE table_name_59 (against VARCHAR,venue VARCHAR,date VARCHAR)
SELECT COUNT(against) FROM table_name_59 WHERE venue = "h" AND date = "26 february 1949"
Cumulative point total for all teams playing on the Discovery Channel?
CREATE TABLE table_57284 ("Rank" real,"Name" text,"Nationality" text,"Team" text,"Points" real)
SELECT COUNT("Points") FROM table_57284 WHERE "Team" = 'discovery channel'
a score of 5 or more on the hashinski ischemic scale ( rosen modification.
CREATE TABLE table_train_112 ("id" int,"systolic_blood_pressure_sbp" int,"modified_geriatric_depression_scale_gds" int,"diastolic_blood_pressure_dbp" int,"rosen_modified_hachinski_ischemic_score" int,"body_mass_index_bmi" float,"hypertension" bool,"NOUSE" float)
SELECT * FROM table_train_112 WHERE rosen_modified_hachinski_ischemic_score >= 5
Name the average is 1991-92 is 39
CREATE TABLE table_1558 ("Team" text,"Average" text,"Points" real,"Played" real,"1991-92" text,"1992-93" text,"1993-94" real)
SELECT "Average" FROM table_1558 WHERE "1991-92" = '39'
What is the total time for all lessons taught by Janessa Sawayn?
CREATE TABLE addresses (address_id number,line_1_number_building text,city text,zip_postcode text,state_province_county text,country text)CREATE TABLE customer_payments (customer_id number,datetime_payment time,payment_method_code text,amount_payment number)CREATE TABLE customers (customer_id number,customer_address_id...
SELECT SUM(lesson_time) FROM lessons AS T1 JOIN staff AS T2 ON T1.staff_id = T2.staff_id WHERE T2.first_name = "Janessa" AND T2.last_name = "Sawayn"
had patient 008-10139 in this year been admitted to an emergency room?
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 treatment (treatmentid number,patientunitstayid number,treatmentname text,...
SELECT COUNT(*) > 0 FROM patient WHERE patient.uniquepid = '008-10139' AND patient.hospitaladmitsource = 'emergency department' AND DATETIME(patient.unitadmittime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
has patient 60136 been tested for urea nitrogen on the current hospital visit?
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 admissions (row_id number,subject_id number,hadm_id number,admittime time,dischtime time,admission_type text,admission_location text,discharge_location text,...
SELECT COUNT(*) > 0 FROM labevents WHERE labevents.itemid IN (SELECT d_labitems.itemid FROM d_labitems WHERE d_labitems.label = 'urea nitrogen') AND labevents.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60136 AND admissions.dischtime IS NULL)
a systolic blood pressure >= 180 mmhg and / or a diastolic blood pressure >= 105 mmhg
CREATE TABLE table_train_108 ("id" int,"mini_mental_state_examination_mmse" int,"systolic_blood_pressure_sbp" int,"hemoglobin_a1c_hba1c" float,"deficiency_to_iga" bool,"diastolic_blood_pressure_dbp" int,"body_mass_index_bmi" float,"NOUSE" float)
SELECT * FROM table_train_108 WHERE systolic_blood_pressure_sbp >= 180 OR diastolic_blood_pressure_dbp >= 105
If round of 32 is sawatvilay phimmasone ( lao ) w pts 9-7, what was the event?
CREATE TABLE table_26335424_86 (event VARCHAR,round_of_32 VARCHAR)
SELECT event FROM table_26335424_86 WHERE round_of_32 = "Sawatvilay Phimmasone ( LAO ) W PTS 9-7"
Top users by specified age.
CREATE TABLE PostTags (PostId number,TagId number)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,Las...
SELECT Id AS "user_link", Reputation, Age, CreationDate, LastAccessDate FROM Users WHERE Age = @age ORDER BY Reputation DESC LIMIT 100
How many years have they offered SPANISH 113 ?
CREATE TABLE course_offering (offering_id int,course_id int,semester int,section_number int,start_time time,end_time time,monday varchar,tuesday varchar,wednesday varchar,thursday varchar,friday varchar,saturday varchar,sunday varchar,has_final_project varchar,has_final_exam varchar,textbook varchar,class_address varch...
SELECT DISTINCT semester.year FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'SPANISH' AND course.number = 113 AND semester.semester_id = course_offering.semester ORDER BY semester.year LIMIT 1
List the titles of the papers whose authors are from the institution 'Indiana University'.
CREATE TABLE authorship (authid number,instid number,paperid number,authorder number)CREATE TABLE authors (authid number,lname text,fname text)CREATE TABLE papers (paperid number,title text)CREATE TABLE inst (instid number,name text,country text)
SELECT DISTINCT t1.title FROM papers AS t1 JOIN authorship AS t2 ON t1.paperid = t2.paperid JOIN inst AS t3 ON t2.instid = t3.instid WHERE t3.name = "Indiana University"
Find questions with not many answers.
CREATE TABLE FlagTypes (Id number,Name text,Description text)CREATE TABLE ReviewTaskTypes (Id number,Name text,Description text)CREATE TABLE PendingFlags (Id number,FlagTypeId number,PostId number,CreationDate time,CloseReasonTypeId number,CloseAsOffTopicReasonTypeId number,DuplicateOfQuestionId number,BelongsOnBaseHos...
SELECT q.Id AS "post_link", q.Score, q.ViewCount, q.AnswerCount FROM Posts AS q WHERE q.PostTypeId = 1 AND q.ClosedDate IS NULL ORDER BY q.AnswerCount, q.ViewCount DESC
count the number of patients whose age is less than 81 and drug code is prismab32k25000?
CREATE TABLE lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid text)CREATE TABLE procedures (subject_id text,hadm_id text,icd9_code text,short_title text,long_title text)CREATE TABLE diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.age < "81" AND prescriptions.formulary_drug_cd = "PRISMAB32K25000"
Create a pie chart showing the total number across competition.
CREATE TABLE city (City_ID int,City text,Hanzi text,Hanyu_Pinyin text,Regional_Population int,GDP real)CREATE TABLE match (Match_ID int,Date text,Venue text,Score text,Result text,Competition text)CREATE TABLE temperature (City_ID int,Jan real,Feb real,Mar real,Apr real,Jun real,Jul real,Aug real,Sep real,Oct real,Nov ...
SELECT Competition, COUNT(*) FROM match GROUP BY Competition
When did the person who died on 6 Dec 1240 get married?
CREATE TABLE table_54748 ("Father" text,"Birth" text,"Marriage" text,"Became Queen" text,"Ceased to be Queen" text,"Death" text,"Spouse" text)
SELECT "Marriage" FROM table_54748 WHERE "Death" = '6 dec 1240'
Return the ids and details corresponding to projects for which there are more than two documents by a pie chart.
CREATE TABLE Ref_Document_Types (Document_Type_Code CHAR(15),Document_Type_Name VARCHAR(255),Document_Type_Description VARCHAR(255))CREATE TABLE Documents_with_Expenses (Document_ID INTEGER,Budget_Type_Code CHAR(15),Document_Details VARCHAR(255))CREATE TABLE Projects (Project_ID INTEGER,Project_Details VARCHAR(255))CRE...
SELECT T1.Project_Details, T1.Project_ID FROM Projects AS T1 JOIN Documents AS T2 ON T1.Project_ID = T2.Project_ID
give me the number of patients whose admission year is less than 2195 and lab test name is urobilinogen?
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 lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.admityear < "2195" AND lab.label = "Urobilinogen"
Which Economic Class has a Barangay of imelda bliss village?
CREATE TABLE table_34158 ("Barangay" text,"Population (2010)" real,"Economic Class" text,"Land Area (In sqm.)" real,"Punong Barangay (Term 2010-2013)" text)
SELECT "Economic Class" FROM table_34158 WHERE "Barangay" = 'imelda bliss village'
What was Australia's score when Peter Lonard played?
CREATE TABLE table_name_6 (score VARCHAR,country VARCHAR,player VARCHAR)
SELECT score FROM table_name_6 WHERE country = "australia" AND player = "peter lonard"
What country did the client Agiba-agip work in?
CREATE TABLE table_name_5 (country VARCHAR,client VARCHAR)
SELECT country FROM table_name_5 WHERE client = "agiba-agip"
What is the Australian letter with a British of and a letter of /i/??
CREATE TABLE table_61413 ("Letter" text,"American" text,"British" text,"Australian" text,"Examples" text)
SELECT "Australian" FROM table_61413 WHERE "British" = 'ɪ' AND "Letter" = 'æ /i/'
indicate the daily maximum amount of foley output that patient 68280 had had since 12/18/2105.
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 inputevents_cv (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,amount number)CREATE TABLE d_labitems (r...
SELECT MAX(outputevents.value) FROM outputevents WHERE outputevents.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 68280)) AND outputevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'fol...
Who is the runner-up from Milwaukee?
CREATE TABLE table_name_27 (runner_up VARCHAR,city VARCHAR)
SELECT runner_up FROM table_name_27 WHERE city = "milwaukee"
In 1950 what is the average rank?
CREATE TABLE table_name_40 (rank INTEGER,year VARCHAR)
SELECT AVG(rank) FROM table_name_40 WHERE year = 1950
What is the nationality of the guard for the chool/Club Team in Virginia?
CREATE TABLE table_name_34 (nationality VARCHAR,position VARCHAR,school_club_team VARCHAR)
SELECT nationality FROM table_name_34 WHERE position = "guard" AND school_club_team = "virginia"
What is the rank of the country with total more than 3 and more than 6 silver?
CREATE TABLE table_name_66 (rank VARCHAR,total VARCHAR,silver VARCHAR)
SELECT rank FROM table_name_66 WHERE total > 3 AND silver > 6
What was the method used when the time was 4:52?
CREATE TABLE table_name_49 (method VARCHAR,time VARCHAR)
SELECT method FROM table_name_49 WHERE time = "4:52"
What is the epa rated combined fuel economy for the Nissan Leaf?
CREATE TABLE table_2955 ("Vehicle" text,"Operating mode" text,"EPA rated All-electric range" text,"EPA rated combined fuel economy" text,"Clean electric grid California (San Francisco)" text,"U.S. national average electric mix" text,"Dirty electric grid Rocky Mountains (Denver)" text)
SELECT "EPA rated combined fuel economy" FROM table_2955 WHERE "Vehicle" = 'Nissan Leaf'
What is the Proto-Germanic origin of the phoneme /[[|j]]/?
CREATE TABLE table_name_2 (proto_germanic_origin VARCHAR,sound__phoneme_ VARCHAR)
SELECT proto_germanic_origin FROM table_name_2 WHERE sound__phoneme_ = "/[[|j]]/"
give me the number of patients whose primary disease is femoral artery thrombosis and age is less than 85?
CREATE TABLE procedures (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 diagnoses (subject_id text,hadm_id text,icd9_code text,short_title text,long_title ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "FEMORAL ARTERY THROMBOSIS" AND demographic.age < "85"
Which Year Ended has a Passenger Load Factor (%) larger than 72.8, and a Revenue ( m) smaller than 906.8?
CREATE TABLE table_5847 ("Year Ended" text,"Passengers Flown" real,"Passenger Load Factor (%)" real,"Revenue (\u20acm)" real,"Profit / (Loss) Before Tax (\u20acm)" text,"Net Profit / (Loss) (\u20acm)" text)
SELECT "Year Ended" FROM table_5847 WHERE "Passenger Load Factor (%)" > '72.8' AND "Revenue (\u20acm)" < '906.8'
what is the drug that patient 021-93953 was prescribed for during the same hospital visit after undergoing mechanical ventilation?
CREATE TABLE patient (uniquepid text,patienthealthsystemstayid number,patientunitstayid number,gender text,age text,ethnicity text,hospitalid number,wardid number,admissionheight number,admissionweight number,dischargeweight number,hospitaladmittime time,hospitaladmitsource text,unitadmittime time,unitdischargetime tim...
SELECT t2.drugname FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid =...
How many total figures are given for Milwaukee county?
CREATE TABLE table_24087 ("County" text,"Won by" text,"Walker %" real,"Walker votes" real,"Barrett %" real,"Barrett votes" real)
SELECT COUNT("Won by") FROM table_24087 WHERE "County" = 'Milwaukee'
What percentage of others have an SZDSZ of 4% and a Fidesz of 60%?
CREATE TABLE table_name_10 (others VARCHAR,szdsz VARCHAR,fidesz VARCHAR)
SELECT others FROM table_name_10 WHERE szdsz = "4%" AND fidesz = "60%"
How many millions of people in the US saw the episode titled 'The Reunion Job'?
CREATE TABLE table_23831 ("Series #" real,"Season #" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"U.S. viewers (in millions)" text)
SELECT "U.S. viewers (in millions)" FROM table_23831 WHERE "Title" = 'The Reunion Job'
Which Supercopa 1994 has a Team of estudiantes?
CREATE TABLE table_name_10 (supercopa_1994 VARCHAR,team VARCHAR)
SELECT supercopa_1994 FROM table_name_10 WHERE team = "estudiantes"
how many entrepreneurs correspond to each investor?
CREATE TABLE entrepreneur (Entrepreneur_ID int,People_ID int,Company text,Money_Requested real,Investor text)CREATE TABLE people (People_ID int,Name text,Height real,Weight real,Date_of_Birth text)
SELECT Investor, COUNT(*) FROM entrepreneur GROUP BY Investor
For each reviewer id, show their corresponding the smallest rating for the movie in a scatter chart.
CREATE TABLE Reviewer (rID int,name text)CREATE TABLE Rating (rID int,mID int,stars int,ratingDate date)CREATE TABLE Movie (mID int,title text,year int,director text)
SELECT rID, MIN(T1.stars) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY rID
On what date was the record 2 1?
CREATE TABLE table_69190 ("Date" text,"Visitor" text,"Score" text,"Home" text,"Record" text)
SELECT "Date" FROM table_69190 WHERE "Record" = '2–1'
whats the sex of patient 97734?
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 outputevents (row_id number,subject_id number,hadm_id number,icustay_id number,charttime time,itemid number,value number)CREATE TABLE labevents (row_i...
SELECT patients.gender FROM patients WHERE patients.subject_id = 97734
What are the allergy types and how many allergies correspond to each one, and order Y in asc order.
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))
SELECT AllergyType, COUNT(*) FROM Allergy_Type GROUP BY AllergyType ORDER BY COUNT(*)
Who were the quarterfinalists for the runner-ups of mike de palmer gary donnelly?
CREATE TABLE table_24490 ("Week of" text,"Tournament" text,"Champion" text,"Runner-up" text,"Semifinalists" text,"Quarterfinalists" text)
SELECT "Quarterfinalists" FROM table_24490 WHERE "Runner-up" = 'Mike De Palmer Gary Donnelly'
What was the theme for week 3?
CREATE TABLE table_name_38 (theme VARCHAR,week VARCHAR)
SELECT theme FROM table_name_38 WHERE week = "week 3"
What's the sum of years when the Artist of the queen were less than 1?
CREATE TABLE table_name_59 (year VARCHAR,artist VARCHAR,weeks_at_number_one VARCHAR)
SELECT COUNT(year) FROM table_name_59 WHERE artist = "queen" AND weeks_at_number_one < 1
Return the name of each physician and the number of patients he or she treats in a bar chart, and I want to sort in ascending by the bars.
CREATE TABLE Affiliated_With (Physician INTEGER,Department INTEGER,PrimaryAffiliation BOOLEAN)CREATE TABLE Appointment (AppointmentID INTEGER,Patient INTEGER,PrepNurse INTEGER,Physician INTEGER,Start DATETIME,End DATETIME,ExaminationRoom TEXT)CREATE TABLE Patient (SSN INTEGER,Name VARCHAR(30),Address VARCHAR(30),Phone ...
SELECT T1.Name, COUNT(*) FROM Physician AS T1 JOIN Patient AS T2 ON T1.EmployeeID = T2.PCP GROUP BY T1.EmployeeID ORDER BY T1.Name
what is the number of government health insurance patients who had laryngoscopy and other tracheoscopy procedure?
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 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,sho...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Government" AND procedures.long_title = "Laryngoscopy and other tracheoscopy"
What kind of school is Canton, New York?
CREATE TABLE table_16381914_1 (affiliation VARCHAR,location VARCHAR)
SELECT affiliation FROM table_16381914_1 WHERE location = "Canton, New York"
How many winners were there when the mountains classification was not awarded?
CREATE TABLE table_25551880_2 (winner VARCHAR,mountains_classification VARCHAR)
SELECT COUNT(winner) FROM table_25551880_2 WHERE mountains_classification = "not awarded"
what now defunct railroad existed for the shortest time ?
CREATE TABLE table_203_674 (id number,"name" text,"mark" text,"system" text,"from" number,"to" number,"successor" text,"notes" text)
SELECT "name" FROM table_203_674 ORDER BY "to" - "from" LIMIT 1
For Prof. Waheed Samy 's classes , is there always an exam ?
CREATE TABLE requirement (requirement_id int,requirement varchar,college varchar)CREATE TABLE student_record (student_id int,course_id int,semester int,grade varchar,how varchar,transfer_source varchar,earn_credit varchar,repeat_term varchar,test_id varchar)CREATE TABLE instructor (instructor_id int,name varchar,uniqna...
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course.has_exams = 'N' AN...
How many years have claudia beni as the artist?
CREATE TABLE table_13646 ("Year" real,"Song" text,"Artist" text,"Place" text,"Points" text)
SELECT SUM("Year") FROM table_13646 WHERE "Artist" = 'claudia beni'
name the only indie/alternative/rock music radio station broadcasted by mxr yorkshire .
CREATE TABLE table_203_603 (id number,"service" text,"service id" text,"bit rate" text,"audio channels" text,"description" text,"analogue availability" text)
SELECT "service" FROM table_203_603 WHERE "description" = 'indie / alternative / rock music'
Who's the First District with a Fifth District of prudy adam?
CREATE TABLE table_41874 ("First District" text,"Second District" text,"Third District" text,"Fourth District" text,"Fifth District" text)
SELECT "First District" FROM table_41874 WHERE "Fifth District" = 'prudy adam'
What is the high grid that has a Time/Retired of +6 laps, and under 69 laps?
CREATE TABLE table_52193 ("Driver" text,"Constructor" text,"Laps" real,"Time/Retired" text,"Grid" real)
SELECT MAX("Grid") FROM table_52193 WHERE "Time/Retired" = '+6 laps' AND "Laps" < '69'
What is the serial number of the pilot car that is black, has a pilot car number larger than 2, and an engine number of 1008?
CREATE TABLE table_name_71 (serial_no VARCHAR,engine_no VARCHAR,colour VARCHAR,pilot_car_no VARCHAR)
SELECT serial_no FROM table_name_71 WHERE colour = "black" AND pilot_car_no > 2 AND engine_no = 1008
What genre has the game god of war?
CREATE TABLE table_13808 ("Year" text,"Game" text,"Genre" text,"Platform(s)" text,"Developer(s)" text)
SELECT "Genre" FROM table_13808 WHERE "Game" = 'god of war'
Name the player/s when there were 20 points with less than 1.0 extra point .
CREATE TABLE table_25730123_2 (player VARCHAR,extra_points VARCHAR,points VARCHAR)
SELECT player FROM table_25730123_2 WHERE extra_points < 1.0 AND points = 20
Who was the opponent in the September 20, 2010 match?
CREATE TABLE table_name_49 (opponent VARCHAR,date VARCHAR)
SELECT opponent FROM table_name_49 WHERE date = "september 20, 2010"
what is the assists when the club is chicago fire and goals is more than 2?
CREATE TABLE table_44928 ("Season" text,"Club" text,"Country" text,"Apps." real,"Goals" real,"Assists" real)
SELECT SUM("Assists") FROM table_44928 WHERE "Club" = 'chicago fire' AND "Goals" > '2'
What are the NFL Teams in College North Texas State?
CREATE TABLE table_2508633_11 (nfl_team VARCHAR,college VARCHAR)
SELECT nfl_team FROM table_2508633_11 WHERE college = "North Texas State"
for patient id 2560, specify the admission type and lab test abnormal status
CREATE TABLE prescriptions (subject_id text,hadm_id text,icustay_id text,drug_type text,drug text,formulary_drug_cd text,route text,drug_dose text)CREATE TABLE demographic (subject_id text,hadm_id text,name text,marital_status text,age text,dob text,gender text,language text,religion text,admission_type text,days_stay ...
SELECT demographic.admission_type, lab.flag FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.subject_id = "2560"
How many episodes of the season had the title, 'world's greatest dick'?
CREATE TABLE table_4191 ("No. in series" real,"No. in season" real,"Title" text,"Directed by" text,"Written by" text,"Original air date" text,"Production code" real)
SELECT COUNT("No. in season") FROM table_4191 WHERE "Title" = 'World''s Greatest Dick'
What is the Freq currently of the 4GG Callsign?
CREATE TABLE table_50343 ("Callsign" text,"Area served" text,"Band" text,"Freq currently" text,"Purpose" text)
SELECT "Freq currently" FROM table_50343 WHERE "Callsign" = '4gg'
Posts about nginx and lua.
CREATE TABLE SuggestedEditVotes (Id number,SuggestedEditId number,UserId number,VoteTypeId number,CreationDate time,TargetUserId number,TargetRepChange number)CREATE TABLE PostLinks (Id number,CreationDate time,PostId number,RelatedPostId number,LinkTypeId number)CREATE TABLE PostHistoryTypes (Id number,Name text)CREAT...
SELECT Title, Posts.Id AS "post_link" FROM Posts RIGHT JOIN (SELECT Posts.Id AS selid FROM Posts JOIN PostTags ON PostId = Posts.Id JOIN Tags ON PostTags.TagId = Tags.Id WHERE Tags.TagName = 'nginx' OR Tags.TagName = 'haproxy' GROUP BY Posts.Id HAVING COUNT(Posts.Id) > 1) AS tmp1 ON Posts.Id = tmp1.selid JOIN PostLinks...
What is the date of the locomotive with a Waterford class?
CREATE TABLE table_70758 ("Class" text,"Type" text,"Names" text,"Quantity made" text,"Manufacturer" text,"Date made" text)
SELECT "Date made" FROM table_70758 WHERE "Class" = 'waterford'
What were the tries on 14/6/97?
CREATE TABLE table_78211 ("Date" text,"Competition" text,"Venue" text,"Result" text,"Score" text,"Tries" text,"Goals" text)
SELECT "Tries" FROM table_78211 WHERE "Date" = '14/6/97'
What Rotterterrode has a Reimboldsh 80?
CREATE TABLE table_14770 ("Gersdorf" text,"Gershausen" text,"Heddersdorf" text,"Kemmerode" text,"Kirchheim" text,"Reckerode ****" text,"Reimboldsh." text,"Rotterterode" text,"Willingshain" text)
SELECT "Rotterterode" FROM table_14770 WHERE "Reimboldsh." = '80'
Name the sum of hull number for italy and year more than 1999
CREATE TABLE table_71732 ("Hull No." real,"Year" real,"Project" text,"Length overall in meters (without bowsprit)" real,"Name" text,"Destination" text)
SELECT SUM("Hull No.") FROM table_71732 WHERE "Destination" = 'italy' AND "Year" > '1999'
For those employees whose salary is in the range of 8000 and 12000 and commission is not null or department number does not equal to 40, show me about the distribution of hire_date and the average of department_id bin hire_date by time in a bar chart.
CREATE TABLE departments (DEPARTMENT_ID decimal(4,0),DEPARTMENT_NAME varchar(30),MANAGER_ID decimal(6,0),LOCATION_ID decimal(4,0))CREATE TABLE employees (EMPLOYEE_ID decimal(6,0),FIRST_NAME varchar(20),LAST_NAME varchar(25),EMAIL varchar(25),PHONE_NUMBER varchar(20),HIRE_DATE date,JOB_ID varchar(10),SALARY decimal(8,2)...
SELECT HIRE_DATE, AVG(DEPARTMENT_ID) FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
What was the winning score with a margin victory of 2 strokes?
CREATE TABLE table_name_81 (winning_score VARCHAR,margin_of_victory VARCHAR)
SELECT winning_score FROM table_name_81 WHERE margin_of_victory = "2 strokes"
Which tyres received 8 points?
CREATE TABLE table_70181 ("Year" real,"Chassis" text,"Engine(s)" text,"Tyres" text,"Points" real)
SELECT "Tyres" FROM table_70181 WHERE "Points" = '8'
give me the number of patients whose admission location is phys referral/normal deli and drug name is sertraline?
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 lab (subject_id text,hadm_id text,itemid text,charttime text,flag text,value_unit text,label text,fluid ...
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND prescriptions.drug = "Sertraline"
Who was the winner when the runner-up was Guangzhou Apollo?
CREATE TABLE table_name_34 (winners VARCHAR,runners_up VARCHAR)
SELECT winners FROM table_name_34 WHERE runners_up = "guangzhou apollo"
Show all cities and corresponding number of students by a bar chart, and I want to display by the Y in desc.
CREATE TABLE Student (StuID INTEGER,LName VARCHAR(12),Fname VARCHAR(12),Age INTEGER,Sex VARCHAR(1),Major INTEGER,Advisor INTEGER,city_code VARCHAR(3))CREATE TABLE Allergy_Type (Allergy VARCHAR(20),AllergyType VARCHAR(20))CREATE TABLE Has_Allergy (StuID INTEGER,Allergy VARCHAR(20))
SELECT city_code, COUNT(*) FROM Student GROUP BY city_code ORDER BY COUNT(*) DESC
How many verbs mean to bear
CREATE TABLE table_1745843_10 (part_4 VARCHAR,verb_meaning VARCHAR)
SELECT COUNT(part_4) FROM table_1745843_10 WHERE verb_meaning = "to bear"
Name the CFL Team which has a Player of chris evraire?
CREATE TABLE table_48382 ("Pick #" real,"CFL Team" text,"Player" text,"Position" text,"College" text)
SELECT "CFL Team" FROM table_48382 WHERE "Player" = 'chris evraire'
How many directors worked on #158?
CREATE TABLE table_25800134_4 (director VARCHAR,series__number VARCHAR)
SELECT COUNT(director) FROM table_25800134_4 WHERE series__number = 158
What's the season number of the episode originally aired on October 14, 2008?
CREATE TABLE table_19401346_1 (no_in_season VARCHAR,original_air_date VARCHAR)
SELECT no_in_season FROM table_19401346_1 WHERE original_air_date = "October 14, 2008"
Find the name and credit score of the customers who have some loans, sort in descending by the cust_name.
CREATE TABLE bank (branch_ID int,bname varchar(20),no_of_customers int,city varchar(10),state varchar(20))CREATE TABLE loan (loan_ID varchar(3),loan_type varchar(15),cust_ID varchar(3),branch_ID varchar(3),amount int)CREATE TABLE customer (cust_ID varchar(3),cust_name varchar(20),acc_type char(1),acc_bal int,no_of_loan...
SELECT cust_name, credit_score FROM customer AS T1 JOIN loan AS T2 ON T1.cust_ID = T2.cust_ID ORDER BY cust_name DESC
What train arrives from Kazipet?
CREATE TABLE table_8589 ("Train No." text,"Train Name" text,"From" text,"Arrival" text,"Runs On" text)
SELECT "Train Name" FROM table_8589 WHERE "From" = 'kazipet'
A scatter chart shows the correlation between CID and Credits .
CREATE TABLE Member_of (FacID INTEGER,DNO INTEGER,Appt_Type VARCHAR(15))CREATE TABLE Minor_in (StuID INTEGER,DNO INTEGER)CREATE TABLE Department (DNO INTEGER,Division VARCHAR(2),DName VARCHAR(25),Room VARCHAR(5),Building VARCHAR(13),DPhone INTEGER)CREATE TABLE Faculty (FacID INTEGER,Lname VARCHAR(15),Fname VARCHAR(15),...
SELECT CID, Credits FROM Course ORDER BY Credits
What is the number of years that the event was foil team and took place in Los Angeles?
CREATE TABLE table_name_77 (year VARCHAR,venue VARCHAR,event VARCHAR)
SELECT COUNT(year) FROM table_name_77 WHERE venue = "los angeles" AND event = "foil team"
At what venue did the away team score 10.10 (70)?
CREATE TABLE table_32948 ("Home team" text,"Home team score" text,"Away team" text,"Away team score" text,"Venue" text,"Crowd" real,"Date" text)
SELECT "Venue" FROM table_32948 WHERE "Away team score" = '10.10 (70)'
Tell me the total number of Grid for Time/Retired of +2 Laps and Laps less than 70
CREATE TABLE table_name_66 (grid VARCHAR,time_retired VARCHAR,laps VARCHAR)
SELECT COUNT(grid) FROM table_name_66 WHERE time_retired = "+2 laps" AND laps < 70
On which award show was Bad Girls nominated for Most Popular Drama in 2004?
CREATE TABLE table_71294 ("Year" real,"Award Show" text,"Category" text,"Recipient(s)" text,"Result" text)
SELECT "Award Show" FROM table_71294 WHERE "Year" = '2004' AND "Category" = 'most popular drama'