table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_4910 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the home team score for the game with the away team Carlton?
SELECT "Home team score" FROM table_4910 WHERE "Away team" = 'carlton'
CREATE TABLE table_name_15 ( entrant VARCHAR, points VARCHAR, chassis VARCHAR, engine VARCHAR, year VARCHAR )
Which entrant, with an Offenhauser L4 engine and a Kurtis Kraft KK500A chassis, scored 9 points before 1955?
SELECT entrant FROM table_name_15 WHERE engine = "offenhauser l4" AND year < 1955 AND chassis = "kurtis kraft kk500a" AND points = 9
CREATE TABLE table_name_37 ( territory VARCHAR, acquired VARCHAR, capital VARCHAR )
What is the territory that was acquired past 1899 and has a capital of saipan?
SELECT territory FROM table_name_37 WHERE acquired > 1899 AND capital = "saipan"
CREATE TABLE stadium ( ID int, name text, Capacity int, City text, Country text, Opening_year int ) CREATE TABLE swimmer ( ID int, name text, Nationality text, meter_100 real, meter_200 text, meter_300 text, meter_400 text, meter_500 text, meter_600 text, ...
A bar chart shows the distribution of meter_600 and ID .
SELECT meter_600, ID FROM swimmer
CREATE TABLE table_name_90 ( winner VARCHAR, location VARCHAR, date VARCHAR )
Who is the winner of the tournament in Georgia on Oct 3?
SELECT winner FROM table_name_90 WHERE location = "georgia" AND date = "oct 3"
CREATE TABLE table_name_5 ( bronze INTEGER, total VARCHAR, silver VARCHAR )
What is the most Bronze medals won among the participants that won less than 22 medals overall and less than 5 silver medals?
SELECT MAX(bronze) FROM table_name_5 WHERE total < 22 AND silver < 5
CREATE TABLE table_15194 ( "Name" text, "Race" text, "Current age" real, "Age at offense" real, "Years on death row" real, "Location of offense" text )
What is the prisoner's name that is currently 29 years old?
SELECT "Name" FROM table_15194 WHERE "Current age" = '29'
CREATE TABLE table_name_45 ( time VARCHAR, event VARCHAR )
What was the time of sportfight 10?
SELECT time FROM table_name_45 WHERE event = "sportfight 10"
CREATE TABLE table_45714 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Record" text )
What is the Record for April 13?
SELECT "Record" FROM table_45714 WHERE "Date" = 'april 13'
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 demographic ...
how many patients born before 2076 have been discharged to short term hospital?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.discharge_location = "SHORT TERM HOSPITAL" AND demographic.dob_year < "2076"
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE labevents ( row_id number, subject_id number, had...
what are the four most frequently occurring specimen tests?
SELECT t1.spec_type_desc FROM (SELECT microbiologyevents.spec_type_desc, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM microbiologyevents GROUP BY microbiologyevents.spec_type_desc) AS t1 WHERE t1.c1 <= 4
CREATE TABLE countries ( country_id text, country_name text, region_id number ) CREATE TABLE jobs ( job_id text, job_title text, min_salary number, max_salary number ) CREATE TABLE regions ( region_id number, region_name text ) CREATE TABLE locations ( location_id number, ...
List the full name (first and last name), and salary for those employees who earn below 6000.
SELECT first_name, last_name, salary FROM employees WHERE salary < 6000
CREATE TABLE table_204_652 ( id number, "title" text, "year" number, "director" text, "country" text, "genre" text, "notes" text )
what is the number of films in this category that came from france during this year ?
SELECT COUNT("title") FROM table_204_652 WHERE "country" = 'france'
CREATE TABLE table_58494 ( "Name" text, "Years" text, "Area" text, "Authority" text, "Decile" text, "Roll" text )
What is the roll number of Poroti school, which has a 6 decile?
SELECT "Roll" FROM table_58494 WHERE "Decile" = '6' AND "Name" = 'poroti school'
CREATE TABLE table_2668367_7 ( incumbent VARCHAR, district VARCHAR )
Who was the incumbent in the Kentucky 8 district?
SELECT incumbent FROM table_2668367_7 WHERE district = "Kentucky 8"
CREATE TABLE dual_carrier ( main_airline varchar, low_flight_number int, high_flight_number int, dual_airline varchar, service_name text ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_description text ) CREATE TABLE restriction ( restriction_code text, ...
i would like information on ground transportation in ATLANTA from the airport to the city in the morning around 9am
SELECT DISTINCT ground_service.transport_type FROM airport, airport_service, city AS CITY_0, city AS CITY_1, ground_service WHERE airport.airport_code = airport_service.airport_code AND CITY_0.city_name = 'ATLANTA' AND CITY_1.city_code = airport_service.city_code AND CITY_1.city_name = 'ATLANTA' AND ground_service.airp...
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod time ) 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 o...
when was the last time patient 1902 was having greater than 64.0 heart rate today?
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 = 1902)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'heart rat...
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 ) ...
provide the number of patients whose admission type is elective and drug name is heparin (iabp)?
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 = "Heparin (IABP)"
CREATE TABLE table_15479 ( "Date" text, "Home captain" text, "Away captain" text, "Venue" text, "Result" text )
Who was the Home Captain at Sabina Park?
SELECT "Home captain" FROM table_15479 WHERE "Venue" = 'sabina park'
CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE patient ( ...
what changes have been made to the wbc x 1000 values in patient 027-141930 second measured on the first hospital visit compared to the first value measured on the first hospital visit?
SELECT (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 = '027-141930' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hosp...
CREATE TABLE table_74113 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
how many teams had an appointment date of 11 april 2011
SELECT COUNT("Team") FROM table_74113 WHERE "Date of appointment" = '11 April 2011'
CREATE TABLE table_14293 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
How many silver medals when the total was 2 and less than 1 bronze?
SELECT SUM("Silver") FROM table_14293 WHERE "Bronze" < '1' AND "Total" = '2'
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE lab ( labid number, pa...
count the number of patients who are diagnosed with coronary artery disease and do not come back to the hospital in the same month until 2104.
SELECT (SELECT COUNT(DISTINCT t1.uniquepid) FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'coronary artery disease' AND STRFTIME('%y', diagnosis.diagnosistime) <= '2104') AS t1) - (SELECT COU...
CREATE TABLE table_name_54 ( laps INTEGER, points VARCHAR, car__number VARCHAR, make VARCHAR )
What is the sum of laps that has a car number of larger than 1, is a ford, and has 155 points?
SELECT SUM(laps) FROM table_name_54 WHERE car__number > 1 AND make = "ford" AND points = 155
CREATE TABLE table_name_77 ( surface VARCHAR, date VARCHAR )
What is the Surface of the match played on October 5, 1987?
SELECT surface FROM table_name_77 WHERE date = "october 5, 1987"
CREATE TABLE table_204_319 ( id number, "mlb\nseason" number, "team\nseason" number, "league" text, "division" text, "finish" text, "wins" number, "losses" number, "win %" number, "gb" text, "postseason" text, "awards" text )
how many losses did the team have in 1981 ?
SELECT SUM("losses") FROM table_204_319 WHERE "mlb\nseason" = 1981
CREATE TABLE buildings ( id int, name text, City text, Height int, Stories int, Status text ) CREATE TABLE Office_locations ( building_id int, company_id int, move_in_year int ) CREATE TABLE Companies ( id int, name text, Headquarters text, Industry text, Sales_...
List the number of each company whose office is in the building in a bar chart, list by the x-axis in asc.
SELECT T3.name, COUNT(T3.name) FROM Office_locations AS T1 JOIN buildings AS T2 ON T1.building_id = T2.id JOIN Companies AS T3 ON T1.company_id = T3.id GROUP BY T3.name ORDER BY T3.name
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 Participates_in ( stuid INTEGER, actid INTEGER ) CREATE TABLE Faculty_Participates_in ( FacID INTEGER...
How many faculty members does each building have? List the result with the name of the building Visualize by bar chart, order total number from low to high order.
SELECT Building, COUNT(*) FROM Faculty GROUP BY Building ORDER BY COUNT(*)
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 t...
what is the number of patients whose diagnoses short title is cor ath unsp vsl ntv/gft and drug route is sl?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE diagnoses.short_title = "Cor ath unsp vsl ntv/gft" AND prescriptions.route = "SL"
CREATE TABLE table_name_90 ( gold INTEGER, total INTEGER )
What is the largest gold with a Total larger than 16?
SELECT MAX(gold) FROM table_name_90 WHERE total > 16
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, Par...
all tags related to Microsoft Office & related Questions.
SELECT t.TagName, t.Count, Body FROM Tags AS t LEFT OUTER JOIN Posts AS p ON t.ExcerptPostId = p.Id WHERE LOWER(Body) LIKE '%ms-word%' OR LOWER(Body) LIKE '%excel%' OR LOWER(Body) LIKE '%powerpoint%' OR LOWER(Body) LIKE '%outlook%' OR LOWER(Body) LIKE '%ms access%' OR LOWER(Body) LIKE '%microsoft access%' OR LOWER(Body...
CREATE TABLE table_1342249_32 ( first_elected VARCHAR, result VARCHAR )
Name the first elected for lost renomination democratic loss
SELECT first_elected FROM table_1342249_32 WHERE result = "Lost renomination Democratic loss"
CREATE TABLE table_name_83 ( attendance INTEGER, date VARCHAR )
What was the attendance of april 17?
SELECT SUM(attendance) FROM table_name_83 WHERE date = "april 17"
CREATE TABLE table_name_88 ( moving_from VARCHAR, transfer_window VARCHAR, source VARCHAR )
Where is the moving from location with a transfer window of summer and the source kerkida.net?
SELECT moving_from FROM table_name_88 WHERE transfer_window = "summer" AND source = "kerkida.net"
CREATE TABLE table_33016 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Attendance" real )
For the 1967 Cleveland Browns season what is the total number of times they played the Minnesota Vikings and had an atttendance smaller than 68,431?
SELECT COUNT("Week") FROM table_33016 WHERE "Opponent" = 'minnesota vikings' AND "Attendance" < '68,431'
CREATE TABLE table_55597 ( "Year" real, "Network" text, "Play-by-play" text, "Color commentator(s)" text, "Ice level reporters" text )
Who did the play-by-play before 1992 with the Ice level reporter Mike Emrick?
SELECT "Play-by-play" FROM table_55597 WHERE "Year" < '1992' AND "Ice level reporters" = 'mike emrick'
CREATE TABLE table_35747 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Partner" text, "Opponents" text, "Score" text )
What is the Score with an Outcome of runner-up, and a Partner that is elizabeth little?
SELECT "Score" FROM table_35747 WHERE "Outcome" = 'runner-up' AND "Partner" = 'elizabeth little'
CREATE TABLE table_45287 ( "Rank" real, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
What is the lest amount of bronzes that ranked 2 and has less silvers than 0?
SELECT MIN("Bronze") FROM table_45287 WHERE "Rank" = '2' AND "Silver" < '0'
CREATE TABLE table_28224 ( "Region" text, "Land area (km 2 )" text, "Rainfall by depth (mm/year)" real, "Rainfall by volume (km 3 /year)" text, "Surface run off (km 3 /year)" text, "Infiltration (km 3 /year)" text, "Evapotranspiration (km 3 /year)" text )
In the Central region, what was the infiltration (km 3 /year)?
SELECT "Infiltration (km 3 /year)" FROM table_28224 WHERE "Region" = 'Central'
CREATE TABLE table_name_11 ( losses INTEGER, goals_for VARCHAR, wins VARCHAR, points VARCHAR )
How many losses altogether were had by teams that won 12 times, had 40-4 points, and more than 57 goals?
SELECT SUM(losses) FROM table_name_11 WHERE wins = 12 AND points = "40-4" AND goals_for > 57
CREATE TABLE wrestler ( wrestler_id number, 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 )
Give the names and locations of all wrestlers.
SELECT name, location FROM wrestler
CREATE TABLE table_name_30 ( long VARCHAR, gain VARCHAR, avg_g VARCHAR, loss VARCHAR )
What's the total long for an avg/g over 0.2, fewer than 2 loss, and a gain less than 8?
SELECT COUNT(long) FROM table_name_30 WHERE avg_g > 0.2 AND loss < 2 AND gain < 8
CREATE TABLE table_203_446 ( id number, "name" text, "gender" text, "age" number, "from" text, "occupation" text, "prize money (usd)" text, "status" text )
what were the number of contestants that were male ?
SELECT COUNT("name") FROM table_203_446 WHERE "gender" = 'male'
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 patient ( uniquep...
how many days have elapsed since patient 004-13127 last received a -monos lab test on their current hospital visit?
SELECT 1 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', lab.labresulttime)) FROM lab WHERE lab.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '004-13127' AND patient.hospi...
CREATE TABLE comment_instructor ( instructor_id int, student_id int, score int, comment_text varchar ) CREATE TABLE student ( student_id int, lastname varchar, firstname varchar, program_id int, declare_major varchar, total_credit int, total_gpa float, entered_as varchar...
Which courses available in Molecular Anthropology satisfy the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number FROM course INNER JOIN area ON course.course_id = area.course_id INNER JOIN program_course ON program_course.course_id = course.course_id WHERE (area.area LIKE '%Molecular Anthropology%' OR course.description LIKE '%Molecular Anthropology%' OR course.name LI...
CREATE TABLE table_name_30 ( score VARCHAR, date VARCHAR )
What was the score of the game from July 18?
SELECT score FROM table_name_30 WHERE date = "july 18"
CREATE TABLE table_33755 ( "Week" real, "Date" text, "Opponent" text, "Result" text, "Record" text, "Attendance" real )
What is the date before week 13 and Miami Dolphins as an opponent?
SELECT "Date" FROM table_33755 WHERE "Week" < '13' AND "Opponent" = 'miami dolphins'
CREATE TABLE table_name_98 ( season_7 VARCHAR, season_6 VARCHAR )
Which Season 7 has a Season 6 of jim treliving?
SELECT season_7 FROM table_name_98 WHERE season_6 = "jim treliving"
CREATE TABLE table_13770460_3 ( type VARCHAR, transfer_fee VARCHAR )
What is the type of the player whose transfer fee was 20m?
SELECT type FROM table_13770460_3 WHERE transfer_fee = "€20M"
CREATE TABLE course_prerequisite ( pre_course_id int, course_id int ) CREATE TABLE jobs ( job_id int, job_title varchar, description varchar, requirement varchar, city varchar, state varchar, country varchar, zip int ) CREATE TABLE comment_instructor ( instructor_id int, ...
What 's the easiest way to fulfill the MDE requirement ?
SELECT DISTINCT course.department, course.name, course.number, program_course.workload, program_course.workload FROM course, program_course WHERE program_course.category LIKE '%MDE%' AND program_course.course_id = course.course_id AND program_course.workload = (SELECT MIN(PROGRAM_COURSEalias1.workload) FROM program_cou...
CREATE TABLE table_name_15 ( game VARCHAR, team VARCHAR )
Which game number did they play the Chicago team?
SELECT game FROM table_name_15 WHERE team = "chicago"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime...
what was patient 030-10559's first output time of the urine on 11/16/this year?
SELECT intakeoutput.intakeoutputtime FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '030-10559')) AND intakeoutput.cellpath LIKE '%output%...
CREATE TABLE table_61824 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Results" text )
Incumbent John Sullivan has what as biggest first elected?
SELECT MAX("First elected") FROM table_61824 WHERE "Incumbent" = 'john sullivan'
CREATE TABLE table_45136 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" real, "Location" text )
What is the opponent after round number 1 with a method of decision (unanimous)?
SELECT "Opponent" FROM table_45136 WHERE "Round" > '1' AND "Method" = 'decision (unanimous)'
CREATE TABLE table_name_93 ( votes INTEGER, draw VARCHAR, artist VARCHAR )
How many votes did Yvetta Kadakas & Ivo Linna, who had less than 4 draws, have?
SELECT SUM(votes) FROM table_name_93 WHERE draw < 4 AND artist = "yvetta kadakas & ivo linna"
CREATE TABLE table_51028 ( "Club" text, "Played" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Points difference" text, "Bonus Points" text, "Points" text )
What are the points against with a points difference?
SELECT "Points against" FROM table_51028 WHERE "Points difference" = 'points difference'
CREATE TABLE table_37519 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Ground" text, "Crowd" real, "Date" text, "Report" text )
Which home team had an away team of the Brisbane Lions?
SELECT "Home team" FROM table_37519 WHERE "Away team" = 'brisbane lions'
CREATE TABLE table_2603 ( "Rank" real, "Athlete" text, "Nation" text, "Olympics" text, "Gold" real, "Silver" real, "Bronze" real, "Total(min. 2 medals)" real )
What nation had the athlete sebastian coe category:articles with hcards?
SELECT "Nation" FROM table_2603 WHERE "Athlete" = 'Sebastian Coe Category:Articles with hCards'
CREATE TABLE table_64490 ( "Japanese Title" text, "Romaji Title" text, "TV Station" text, "Episodes" real, "Average Ratings" text )
For the Japanese title that had 11 episodes, what is the average ratings?
SELECT "Average Ratings" FROM table_64490 WHERE "Episodes" = '11' AND "Japanese Title" = 'サプリ'
CREATE TABLE table_53719 ( "Date" text, "Visitor" text, "Score" text, "Home" text, "Decision" text, "Attendance" real, "Record" text )
What is the date of the game where Dipietro earned a decision and Carolina was the visiting team?
SELECT "Date" FROM table_53719 WHERE "Decision" = 'dipietro' AND "Visitor" = 'carolina'
CREATE TABLE table_204_910 ( id number, "rank" number, "name" text, "nationality" text, "result" number, "notes" text )
which country came in first ?
SELECT "nationality" FROM table_204_910 WHERE id = 1
CREATE TABLE table_77366 ( "Movie Title" text, "Year" real, "Role" text, "Director" text, "Producer" text )
What year was Jamboree made?
SELECT "Year" FROM table_77366 WHERE "Movie Title" = 'jamboree'
CREATE TABLE table_44945 ( "The Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text )
Which Year has a Division larger than 3?
SELECT MAX("The Year") FROM table_44945 WHERE "Division" > '3'
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 )
For those records from the products and each product's manufacturer, a bar chart shows the distribution of name and revenue , and group by attribute name, display in asc by the X.
SELECT T1.Name, T2.Revenue FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T1.Name, T1.Name ORDER BY T1.Name
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) 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 program ( progr...
How many of the 9 -credit classes are upper level ?
SELECT COUNT(DISTINCT course.course_id) FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.credits = 9 AND program_course.category LIKE 'ULCS'
CREATE TABLE table_name_81 ( mountains_classification VARCHAR, team_classification VARCHAR )
Which Mountains classification has a Team classification of quick step?
SELECT mountains_classification FROM table_name_81 WHERE team_classification = "quick step"
CREATE TABLE table_455 ( "Episode" text, "Theme" text, "Song choice" text, "Original artist" text, "Order #" text, "Result" text )
What is the order number for songs by the original artist Luis Fonsi?
SELECT "Order #" FROM table_455 WHERE "Original artist" = 'Luis Fonsi'
CREATE TABLE table_name_94 ( home_team VARCHAR, attendance VARCHAR, away_team VARCHAR )
What is Home Team, when Attendance is '112', and when Away Team is 'Kentish Town'?
SELECT home_team FROM table_name_94 WHERE attendance = "112" AND away_team = "kentish town"
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 diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime ti...
what were the three most frequently prescribed drugs at the same time, since 2 years ago, among the patients who were prescribed with heparin flush port (10units/ml)?
SELECT t3.drug FROM (SELECT t2.drug, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, prescriptions.startdate FROM prescriptions JOIN admissions ON prescriptions.hadm_id = admissions.hadm_id WHERE prescriptions.drug = 'heparin flush port (10units/ml)' AND DATETIME(prescriptions.start...
CREATE TABLE table_10267 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
When st kilda played as the Away team which date was that?
SELECT "Date" FROM table_10267 WHERE "Away team" = 'st kilda'
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 ) C...
how many patients whose primary disease is brain mass;intracranial hemorrhage and lab test fluid is joint fluid?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "BRAIN MASS;INTRACRANIAL HEMORRHAGE" AND lab.fluid = "Joint Fluid"
CREATE TABLE table_65002 ( "World record" text, "Snatch" text, "Yang Lian ( CHN )" text, "98kg" text, "Santo Domingo , Dominican" text )
What is the figure for Santo Domingo, Dominican for the world record in the clean & jerk?
SELECT "Santo Domingo , Dominican" FROM table_65002 WHERE "World record" = 'clean & jerk'
CREATE TABLE table_203_355 ( id number, "year" number, "total" number, "romanians" text, "hungarians" text, "roma" text )
what were the total number of times the romanians had a population percentage above 70 % ?
SELECT COUNT(*) FROM table_203_355 WHERE "romanians" > 70
CREATE TABLE camera_lens ( id int, brand text, name text, focal_length_mm real, max_aperture real ) CREATE TABLE mountain ( id int, name text, Height real, Prominence real, Range text, Country text ) CREATE TABLE photos ( id int, camera_lens_id int, mountain_id ...
A bar chart for what are the number of the names of photos taken with the lens brand 'Sigma' or 'Olympus'?, and sort by the names in descending please.
SELECT T1.name, COUNT(T1.name) FROM camera_lens AS T1 JOIN photos AS T2 ON T2.camera_lens_id = T1.id WHERE T1.brand = 'Sigma' OR T1.brand = 'Olympus' GROUP BY T1.name ORDER BY T1.name DESC
CREATE TABLE university ( School_ID int, School text, Location text, Founded real, Affiliation text, Enrollment real, Nickname text, Primary_conference text ) CREATE TABLE basketball_match ( Team_ID int, School_ID int, Team_Name text, ACC_Regular_Season text, ACC_Per...
Give me a bar chart for team_id of each all neutral, I want to rank by the bar from low to high.
SELECT All_Neutral, Team_ID FROM basketball_match ORDER BY All_Neutral
CREATE TABLE college ( cname text, state text, enr number ) CREATE TABLE tryout ( pid number, cname text, ppos text, decision text ) CREATE TABLE player ( pid number, pname text, ycard text, hs number )
What are the names of colleges in LA that have more than 15,000 students and of colleges in AZ with less than 13,000 students?
SELECT cname FROM college WHERE enr < 13000 AND state = "AZ" UNION SELECT cname FROM college WHERE enr > 15000 AND state = "LA"
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 ) ...
How is Nitroglycerin SL administered?
SELECT prescriptions.route FROM prescriptions WHERE prescriptions.drug = "Nitroglycerin SL"
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 ) C...
give me the number of patients whose insurance is private and procedure icd9 code is 4105?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.insurance = "Private" AND procedures.icd9_code = "4105"
CREATE TABLE table_name_3 ( conductor VARCHAR, orchestra VARCHAR )
Who is the conductor when the chicago symphony orchestra is featured?
SELECT conductor FROM table_name_3 WHERE orchestra = "chicago symphony orchestra"
CREATE TABLE table_name_81 ( Id VARCHAR )
Which 2007 has a 2003 of 1r?
SELECT 2007 FROM table_name_81 WHERE 2003 = "1r"
CREATE TABLE table_13338 ( "Name" text, "Platform" text, "Indication" text, "Status" text, "Collaboration" text )
What company collaborated in pre-clinical autoimmune disease and inflammation?
SELECT "Collaboration" FROM table_13338 WHERE "Status" = 'pre-clinical' AND "Indication" = 'autoimmune disease and inflammation'
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnonymous boolean, Vote...
Count of posts by age in days.
WITH PostAge AS (SELECT Id, DATEDIFF(day, CreationDate, @LastVote) AS Age FROM Posts WHERE PostTypeId = '##PostTypeId:int?2##'), PostsByAge AS (SELECT Age, COUNT(*) AS Count FROM PostAge GROUP BY Age) SELECT Age, Count, SUM(Count) OVER (ORDER BY Age DESC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS RollingCount...
CREATE TABLE table_15265 ( "Rank" real, "Population" real, "Name" text, "Former Name" text, "Municipality" text )
What is the rank of the town with a population of 258?
SELECT COUNT("Rank") FROM table_15265 WHERE "Population" = '258'
CREATE TABLE table_27906667_2 ( legs_won INTEGER, player VARCHAR )
How many legs were own by alan tabern?
SELECT MAX(legs_won) FROM table_27906667_2 WHERE player = "Alan Tabern"
CREATE TABLE table_16268026_3 ( state VARCHAR, interview VARCHAR )
What state has an interview of 8.313 (8) ?
SELECT state FROM table_16268026_3 WHERE interview = "8.313 (8)"
CREATE TABLE table_8688 ( "Winner" text, "Country" text, "Winter Olympics" text, "FIS Nordic World Ski Championships" text, "Holmenkollen" text )
The winner Arnfinn Bergmann has what under country?
SELECT "Country" FROM table_8688 WHERE "Winner" = 'arnfinn bergmann'
CREATE TABLE table_78391 ( "Outcome" text, "Date" text, "Tournament" text, "Surface" text, "Opponent" text, "Score" text )
What kind of surface was the tournament at Pune played on?
SELECT "Surface" FROM table_78391 WHERE "Tournament" = 'pune'
CREATE TABLE table_name_9 ( word__number INTEGER, name VARCHAR, subframe__number VARCHAR )
What is the average word count with crs and subframes lesser than 2?
SELECT AVG(word__number) FROM table_name_9 WHERE name = "crs" AND subframe__number < 2
CREATE TABLE table_name_4 ( position INTEGER, draws VARCHAR, goals_against VARCHAR, goals_for VARCHAR )
Name the average position when the goals against are more than 42 and draws less than 16 with goals of 44
SELECT AVG(position) FROM table_name_4 WHERE goals_against > 42 AND goals_for = 44 AND draws < 16
CREATE TABLE table_name_9 ( date VARCHAR, site VARCHAR )
Which date had a site of N/A?
SELECT date FROM table_name_9 WHERE site = "n/a"
CREATE TABLE table_13464416_6 ( record VARCHAR, high_assists VARCHAR )
how many times have there been helps by damon stoudamire (13)
SELECT COUNT(record) FROM table_13464416_6 WHERE high_assists = "Damon Stoudamire (13)"
CREATE TABLE table_20854943_2 ( loa__metres_ VARCHAR, yacht VARCHAR )
How many LOA (metres) reported for Black Jack?
SELECT COUNT(loa__metres_) FROM table_20854943_2 WHERE yacht = "Black Jack"
CREATE TABLE Fault_Log ( fault_log_entry_id INTEGER, asset_id INTEGER, recorded_by_staff_id INTEGER, fault_log_entry_datetime DATETIME, fault_description VARCHAR(255), other_fault_details VARCHAR(255) ) CREATE TABLE Maintenance_Contracts ( maintenance_contract_id INTEGER, maintenance_co...
A bar chart about the number of faults for different fault short name, order by the bar in ascending.
SELECT fault_short_name, COUNT(fault_short_name) FROM Part_Faults AS T1 JOIN Skills_Required_To_Fix AS T2 ON T1.part_fault_id = T2.part_fault_id JOIN Skills AS T3 ON T2.skill_id = T3.skill_id GROUP BY fault_short_name ORDER BY fault_short_name
CREATE TABLE table_name_79 ( team VARCHAR, game VARCHAR )
Who was the team for game 34?
SELECT team FROM table_name_79 WHERE game = 34
CREATE TABLE table_name_60 ( date VARCHAR, score VARCHAR )
What was the date of the game with a score of 2 1?
SELECT date FROM table_name_60 WHERE score = "2–1"
CREATE TABLE table_67930 ( "Year" text, "League" text, "Reg. Season" text, "Playoffs" text, "Avg. attendance \u2020" text )
What regular season had an average attendance of 1,242?
SELECT "Reg. Season" FROM table_67930 WHERE "Avg. attendance \u2020" = '1,242'
CREATE TABLE table_name_10 ( channel VARCHAR, digital_terrestrial_channel VARCHAR, position VARCHAR, analogue_terrestrial_channel VARCHAR, internet VARCHAR )
What is the channel when the analogue terrestrial channel shows n/a, and the internet is itv.com, with a position larger than 6, and digital terrestrial channel is 6 27 (+1)?
SELECT channel FROM table_name_10 WHERE analogue_terrestrial_channel = "n/a" AND internet = "itv.com" AND position > 6 AND digital_terrestrial_channel = "6 27 (+1)"
CREATE TABLE table_28715942_6 ( arranger_s_ VARCHAR, track VARCHAR )
Who is the arranger for 'I KIssed a Girl'?
SELECT arranger_s_ FROM table_28715942_6 WHERE track = "I Kissed a Girl"
CREATE TABLE table_53427 ( "Name" text, "League" real, "FA Cup" real, "League Cup" real, "Total" real )
What is the lowest number of goals scored by a player in the normal league games where more than 8 total goals were scored?
SELECT MIN("League") FROM table_53427 WHERE "Total" > '8'
CREATE TABLE table_43785 ( "Name" text, "Latitude" text, "Longitude" text, "Diameter (km)" real, "Year named" real )
How long is the diameter that has a longitude of 8.0e?
SELECT "Diameter (km)" FROM table_43785 WHERE "Longitude" = '8.0e'