table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE Asset_Parts ( asset_id INTEGER, part_id INTEGER ) CREATE TABLE Third_Party_Companies ( company_id INTEGER, company_type VARCHAR(5), company_name VARCHAR(255), company_address VARCHAR(255), other_company_details VARCHAR(255) ) CREATE TABLE Skills ( skill_id INTEGER, ski...
A bar chart about the number of faults for different fault status of all the faults recoreded in the logs, list in desc by the X-axis please.
SELECT fault_status, COUNT(fault_status) FROM Fault_Log AS T1 JOIN Fault_Log_Parts AS T2 ON T1.fault_log_entry_id = T2.fault_log_entry_id GROUP BY fault_status ORDER BY fault_status DESC
CREATE TABLE table_48330 ( "Model Number" text, "Clock Speed" text, "L2 Cache" text, "FSB Speed" text, "Clock Multiplier" text, "Voltage Range" text, "Socket" text, "Release Date" text )
Which Socket has a FSB Speed of 400 mhz, and a Voltage Range of 1.004 v?
SELECT "Socket" FROM table_48330 WHERE "FSB Speed" = '400 mhz' AND "Voltage Range" = '1.004 v'
CREATE TABLE Manufacturers ( Code INTEGER, Name VARCHAR(255), Headquarter VARCHAR(255), Founder VARCHAR(255), Revenue REAL ) CREATE TABLE Products ( Code INTEGER, Name VARCHAR(255), Price DECIMAL, Manufacturer INTEGER )
For those records from the products and each product's manufacturer, visualize a bar chart about the distribution of founder and the average of price , and group by attribute founder, display by the X-axis from low to high please.
SELECT Founder, AVG(Price) FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY Founder ORDER BY Founder
CREATE TABLE table_28677723_5 ( trine_dehli_cleve INTEGER )
What is the largest number for trine dehli cleve?
SELECT MAX(trine_dehli_cleve) FROM table_28677723_5
CREATE TABLE table_79668 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Wha is the average number of bronze of hungary, which has less than 1 silver?
SELECT AVG("Bronze") FROM table_79668 WHERE "Nation" = 'hungary' AND "Silver" < '1'
CREATE TABLE table_9838 ( "Res." text, "Record" text, "Opponent" text, "Method" text, "Event" text, "Round" text )
What is the event when the method was tko (punches), and the record was 7-1?
SELECT "Event" FROM table_9838 WHERE "Method" = 'tko (punches)' AND "Record" = '7-1'
CREATE TABLE table_name_94 ( position VARCHAR, pick VARCHAR )
What is pick 246's position?
SELECT position FROM table_name_94 WHERE pick = 246
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...
what is the total number of patients treated with albuterol-ipratropium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE prescriptions.drug = "Albuterol-Ipratropium"
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE microbiologyevents ( row_id number, subject_id number, hadm_id number, charttime time, spec_type_desc text, org...
how much does patient 728 weigh based on the first measurement during the first hospital visit?
SELECT chartevents.valuenum 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 = 728 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1)) AND chartevents.itemi...
CREATE TABLE table_name_3 ( district VARCHAR, incumbent VARCHAR, first_elected VARCHAR, result VARCHAR )
What district is James Humphrey from who was first elected in 1858 and was eventually defeated democratic gain?
SELECT district FROM table_name_3 WHERE first_elected = 1858 AND result = "defeated democratic gain" AND incumbent = "james humphrey"
CREATE TABLE table_name_35 ( opponent VARCHAR, loss VARCHAR )
Who was the opponent with a Loss of Leal (1 4)?
SELECT opponent FROM table_name_35 WHERE loss = "leal (1–4)"
CREATE TABLE table_name_90 ( opponent VARCHAR, site_stadium VARCHAR, date VARCHAR )
Who was the opponent at Baum Stadium on April 6?
SELECT opponent FROM table_name_90 WHERE site_stadium = "baum stadium" AND date = "april 6"
CREATE TABLE table_19226 ( "Country/Territory" text, "Former pageant" text, "Last competed" real, "New pageant" text, "Franchise since" real )
which country has miss universe Hungary as former pageant?
SELECT "Country/Territory" FROM table_19226 WHERE "Former pageant" = 'Miss Universe Hungary'
CREATE TABLE table_name_82 ( loss INTEGER, gain VARCHAR )
Can you tell me the sum of Loss that has the Gain of 2646?
SELECT SUM(loss) FROM table_name_82 WHERE gain = 2646
CREATE TABLE table_28263 ( "AB - Angry boar" text, "B - Bishop" text, "BA - Running Bear" text, "BB - Blind Bear" text, "BC - Beast Cadet" text )
what is ba - running bear where ab - angry boar is os - ox soldier?
SELECT "BA - Running Bear" FROM table_28263 WHERE "AB - Angry boar" = 'OS - Ox Soldier'
CREATE TABLE table_name_91 ( opponent VARCHAR, week VARCHAR, score VARCHAR )
Who was the opponent at the game with a score of 42-28 after week 4?
SELECT opponent FROM table_name_91 WHERE week > 4 AND score = "42-28"
CREATE TABLE table_name_26 ( away_team VARCHAR, home_team VARCHAR )
What did the away team score when they visited south melbourne?
SELECT away_team AS score FROM table_name_26 WHERE home_team = "south melbourne"
CREATE TABLE table_69483 ( "Low Estimate" real, "High Estimate" real, "Type" text, "Location" text, "Date" text )
With a type of mass suicide located in France and a low estimate greater than 16, the sum of the high estimate numbers listed is what number?
SELECT SUM("High Estimate") FROM table_69483 WHERE "Type" = 'mass suicide' AND "Location" = 'france' AND "Low Estimate" > '16'
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 ) ...
what is the number of patients whose diagnoses long title is unspecified disease of pericardium?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE diagnoses.long_title = "Unspecified disease of pericardium"
CREATE TABLE table_237036_2 ( _extended_and_main_profiles VARCHAR, baseline INTEGER, level VARCHAR )
What is the baseline extended and main profiles when level is 1.3?
SELECT MIN(baseline), _extended_and_main_profiles FROM table_237036_2 WHERE level = "1.3"
CREATE TABLE table_name_33 ( goals_for VARCHAR, points_1 VARCHAR, drawn VARCHAR, lost VARCHAR )
What is the total number of goals for when the drawn is less than 7, less than 21 games have been lost, and there are 1 of 33 points?
SELECT COUNT(goals_for) FROM table_name_33 WHERE drawn < 7 AND lost < 21 AND points_1 = "33"
CREATE TABLE table_78999 ( "Country" text, "Transfers In" text, "Transfers Out" text, "Internal Transfers" text, "Total Transfers" text )
What are the transfers in for Hungary?
SELECT "Transfers In" FROM table_78999 WHERE "Country" = 'hungary'
CREATE TABLE fare ( fare_id int, from_airport varchar, to_airport varchar, fare_basis_code text, fare_airline text, restriction_code text, one_direction_cost int, round_trip_cost int, round_trip_required varchar ) CREATE TABLE food_service ( meal_code text, meal_number int, ...
show me the cheapest flight on 6 14 arriving in BALTIMORE starting from DALLAS
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, airport_service AS AIRPORT_SERVICE_2, airport_service AS AIRPORT_SERVICE_3, city AS CITY_0, city AS CITY_1, city AS CITY_2, city AS CITY_3, date_day AS DATE_DAY_0, date_day AS DATE_DAY_1, days AS DAYS_0, da...
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...
give me the number of patients whose primary disease is bowel obstruction and age is less than 82?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.diagnosis = "BOWEL OBSTRUCTION" AND demographic.age < "82"
CREATE TABLE table_name_16 ( surname VARCHAR, first VARCHAR )
What is Michael's surname?
SELECT surname FROM table_name_16 WHERE first = "michael"
CREATE TABLE table_64920 ( "Rank" real, "Rowers" text, "Country" text, "Time" text, "Notes" text )
Which rowers represented the country of portugal?
SELECT "Rowers" FROM table_64920 WHERE "Country" = 'portugal'
CREATE TABLE table_name_12 ( points VARCHAR, laps VARCHAR )
What is the number of points associated with 165 laps?
SELECT points FROM table_name_12 WHERE laps = 165
CREATE TABLE member ( name VARCHAR, address VARCHAR )
Give me the names of members whose address is in Harford or Waterbury.
SELECT name FROM member WHERE address = 'Harford' OR address = 'Waterbury'
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...
count the number of patients whose age is less than 79 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.age < "79" AND lab.fluid = "Joint Fluid"
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_proje...
What are the course requirements for THEORY 721 ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0 INNER JOIN course_prerequisite ON COURSE_0.course_id = course_prerequisite.course_id INNER JOIN course AS COURSE_1 ON COURSE_1.course_id = course_prerequisite.pre_course_id WHERE COURSE_0.department = 'THEORY' AND COURSE_0.numbe...
CREATE TABLE diagnoses ( 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 ) C...
what is maximum age of patients whose marital status is widowed and age is greater than or equal to 47?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.marital_status = "WIDOWED" AND demographic.age >= "47"
CREATE TABLE table_name_68 ( date VARCHAR, opponent VARCHAR )
What is the date when Canada played?
SELECT date FROM table_name_68 WHERE opponent = "canada"
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE cost ( costid number, ...
what are the four most frequently given microbiology tests for patients who have previously received therapeutic antibacterials - fourth generation cephalosporin within 2 months, in the previous year?
SELECT t3.culturesite FROM (SELECT t2.culturesite, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'therapeutic antibacterials - fourth generati...
CREATE TABLE table_name_14 ( condition VARCHAR, partial_thromboplastin_time VARCHAR )
Name the condition with partial thromboplastin time of prolonged or unaffected
SELECT condition FROM table_name_14 WHERE partial_thromboplastin_time = "prolonged or unaffected"
CREATE TABLE table_74674 ( "Institution" text, "Nickname" text, "Location" text, "Founded" real, "Type" text, "Enrollment" real )
Which college's enrollment is less than 1,000?
SELECT "Institution" FROM table_74674 WHERE "Enrollment" < '1,000'
CREATE TABLE offering_instructor ( offering_instructor_id int, offering_id int, instructor_id int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABLE course_offering ( offering_id int, course_id int, semes...
820 will be offered at which times of the week ?
SELECT DISTINCT course_offering.end_time, course_offering.friday, course_offering.monday, course_offering.saturday, course_offering.start_time, course_offering.sunday, course_offering.thursday, course_offering.tuesday, course_offering.wednesday FROM semester INNER JOIN course_offering ON semester.semester_id = course_o...
CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time ) CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TA...
when was last time the temperature of patient 022-178583 was less than 33.0 on 07/17/this year?
SELECT vitalperiodic.observationtime FROM vitalperiodic WHERE vitalperiodic.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '022-178583')) AND vitalperiodic.temperature < 33.0 ...
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE intakeoutput ( intakeoutputid number, patientunitstayid number, cellpath text, celllabel text, cellvaluenumeric number, intakeoutputtime time )...
is there any medication that patient 006-185446 received?
SELECT COUNT(*) > 0 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '006-185446'))
CREATE TABLE table_name_73 ( medal VARCHAR, name VARCHAR )
What is the medal named fatuma roba category:articles with hcards for?
SELECT medal FROM table_name_73 WHERE name = "fatuma roba category:articles with hcards"
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...
how many male patients had the procedure icd9 code 5651?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.gender = "M" AND procedures.icd9_code = "5651"
CREATE TABLE table_name_61 ( bronze INTEGER, nation VARCHAR, total VARCHAR )
When the united states won a total number of medals larger than 25, what was the lowest amount of Bronze medals won?
SELECT MIN(bronze) FROM table_name_61 WHERE nation = "united states" AND total > 25
CREATE TABLE party ( party_id number, year number, party text, governor text, lieutenant_governor text, comptroller text, attorney_general text, us_senate text ) CREATE TABLE county ( county_id number, county_name text, population number, zip_code text ) CREATE TABLE el...
Count the total number of counties.
SELECT COUNT(*) FROM county
CREATE TABLE table_203_38 ( id number, "#" number, "title" text, "producer(s)" text, "performer(s)" text, "length" text )
how many songs are at least 4 minutes long ?
SELECT COUNT("title") FROM table_203_38 WHERE "length" >= 4
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 ) CRE...
what was the last value of anion gap of patient 013-12480 on the first hospital visit?
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 = '013-12480' AND NOT patient.hospitaldischargetime IS NULL ORDER BY patient.hospitaladmit...
CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, register_year text ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, ...
Show all distinct city where branches with at least 100 memberships are located.
SELECT DISTINCT city FROM branch WHERE membership_amount >= 100
CREATE TABLE round ( Round_ID int, Member_ID int, Decoration_Theme text, Rank_in_Round int ) CREATE TABLE college ( College_ID int, Name text, Leader_Name text, College_Location text ) CREATE TABLE member ( Member_ID int, Name text, Country text, College_ID int )
Show the different countries and the number of members from each with a bar chart.
SELECT Country, COUNT(*) FROM member GROUP BY Country
CREATE TABLE table_name_30 ( pole_position VARCHAR, fastest_lap VARCHAR, round VARCHAR )
What pole position was Rubens Barrichello when he had the fastest lap and a round larger than 11?
SELECT pole_position FROM table_name_30 WHERE fastest_lap = "rubens barrichello" AND round > 11
CREATE TABLE table_76511 ( "Finished" text, "Horse" text, "Jockey" text, "Trainer" text, "Odds" text )
What is the Finished place for da'tara trained by Nick zito?
SELECT "Finished" FROM table_76511 WHERE "Trainer" = 'nick zito' AND "Horse" = 'da''tara'
CREATE TABLE table_5160 ( "Round" text, "Pick" real, "Overall" real, "Name" text, "Position" text, "Team" text )
What is the players name in the guard position?
SELECT "Name" FROM table_5160 WHERE "Position" = 'guard'
CREATE TABLE museums ( museum_id number, museum_details text ) CREATE TABLE tourist_attraction_features ( tourist_attraction_id number, feature_id number ) CREATE TABLE visitors ( tourist_id number, tourist_details text ) CREATE TABLE locations ( location_id number, location_name text...
Show the average price of hotels for each star rating code.
SELECT star_rating_code, AVG(price_range) FROM hotels GROUP BY star_rating_code
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
How much do I use StackExchange?.
SELECT SUBSTRING(CAST(TIME_TO_STR(CreationDate, '%H:%M:%S') AS TEXT(30)), 0, 6), COUNT(Id) FROM Posts WHERE OwnerUserId = '##UserId##' GROUP BY SUBSTRING(CAST(TIME_TO_STR(CreationDate, '%H:%M:%S') AS TEXT(30)), 0, 6)
CREATE TABLE purchase ( member_id number, branch_id text, year text, total_pounds number ) CREATE TABLE member ( member_id number, card_number text, name text, hometown text, level number ) CREATE TABLE membership_register_branch ( member_id number, branch_id text, regi...
What are the names and cities of the branches that do not have any registered members?
SELECT name, city FROM branch WHERE NOT branch_id IN (SELECT branch_id FROM membership_register_branch)
CREATE TABLE table_17357929_1 ( lost INTEGER )
What is the fewest number of games lost?
SELECT MIN(lost) FROM table_17357929_1
CREATE TABLE table_55812 ( "Locomotive" text, "Serial No" text, "Entered service" text, "Gauge" text, "Livery" text )
What is the livery of the locomotive with a serial number 83-1010?
SELECT "Livery" FROM table_55812 WHERE "Serial No" = '83-1010'
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_items ( row_id number, itemid number, label text, linksto text ) CREATE TABLE d_icd_diagnoses ( row_id number...
what medicine has been prescribed to patient 78221 for the first time until 65 months ago?
SELECT prescriptions.drug FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 78221) AND DATETIME(prescriptions.startdate) <= DATETIME(CURRENT_TIME(), '-65 month') ORDER BY prescriptions.startdate LIMIT 1
CREATE TABLE table_name_43 ( loss VARCHAR, date VARCHAR )
What loss happened june 8?
SELECT loss FROM table_name_43 WHERE date = "june 8"
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE admissions ( row_id number, subject_id number, hadm_id number, admittime time, dischtime time, admission_type text, admission_location text, d...
has patient 12775 had any kind of diagnosis in this year?
SELECT COUNT(*) > 0 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 12775) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year')
CREATE TABLE table_2327 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (fall 2010)" real, "Founded" real, "Accreditation" text )
What is the control for the school accredited by the higher learning commission ( nca ), ccne?
SELECT "Control" FROM table_2327 WHERE "Accreditation" = 'The Higher Learning Commission ( NCA ), CCNE'
CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) CREATE TABLE Tags ( Id number, TagName text, C...
Number of users per month.
SELECT DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) AS Month, COUNT(DATEADD(month, DATEDIFF(month, 0, CreationDate), 0)) AS "Monthly Joins" FROM Users GROUP BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0) ORDER BY DATEADD(month, DATEDIFF(month, 0, CreationDate), 0)
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, ...
what is admission location and discharge time of subject id 17787?
SELECT demographic.admission_location, demographic.dischtime FROM demographic WHERE demographic.subject_id = "17787"
CREATE TABLE table_203_47 ( id number, "game" number, "date" text, "opponent" text, "location" text, "score" text, "ot" text, "attendance" number, "record" text )
which date had the most people in attendance ?
SELECT "date" FROM table_203_47 ORDER BY "attendance" DESC LIMIT 1
CREATE TABLE table_name_53 ( bbc_two_rank VARCHAR, year VARCHAR )
What was the rank of BBC 2 in 2005?
SELECT bbc_two_rank FROM table_name_53 WHERE year = "2005"
CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0), STREET_ADDRESS varchar(40), POSTAL_CODE varchar(12), CITY varchar(30), STATE_PROVINCE varchar(25...
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, a line chart shows the trend of commission_pct over hire_date .
SELECT HIRE_DATE, COMMISSION_PCT FROM employees WHERE SALARY BETWEEN 8000 AND 12000 AND COMMISSION_PCT <> "null" OR DEPARTMENT_ID <> 40
CREATE TABLE table_name_22 ( country VARCHAR, swimsuit VARCHAR, average VARCHAR, interview VARCHAR )
Which country has swimsuit more than 9.46 and interview more than 9.22 with average less than 9.6?
SELECT country FROM table_name_22 WHERE average < 9.6 AND interview > 9.22 AND swimsuit > 9.46
CREATE TABLE station_company ( Station_ID int, Company_ID int, Rank_of_the_Year int ) CREATE TABLE gas_station ( Station_ID int, Open_Year int, Location text, Manager_Name text, Vice_Manager_Name text, Representative_Name text ) CREATE TABLE company ( Company_ID int, Rank i...
What are the main indstries and total market value for each industry Visualize by bar chart, I want to sort Y-axis in descending order.
SELECT Main_Industry, SUM(Market_Value) FROM company GROUP BY Main_Industry ORDER BY SUM(Market_Value) DESC
CREATE TABLE code_description ( code varchar, description text ) CREATE TABLE airport_service ( city_code varchar, airport_code varchar, miles_distant int, direction varchar, minutes_distant int ) CREATE TABLE class_of_service ( booking_class varchar, rank int, class_descriptio...
get flights from MILWAUKEE to DTW
SELECT DISTINCT flight.flight_id FROM airport, airport_service, city, flight WHERE airport.airport_code = 'DTW' AND city.city_code = airport_service.city_code AND city.city_name = 'MILWAUKEE' AND flight.from_airport = airport_service.airport_code AND flight.to_airport = airport.airport_code
CREATE TABLE table_name_44 ( score VARCHAR, loss VARCHAR )
What was the score of the game when there was a loss of Kern (0-2)?
SELECT score FROM table_name_44 WHERE loss = "kern (0-2)"
CREATE TABLE days ( days_code varchar, day_name varchar ) CREATE TABLE ground_service ( city_code text, airport_code text, transport_type text, ground_fare int ) CREATE TABLE flight ( aircraft_code_sequence text, airline_code varchar, airline_flight text, arrival_time int, ...
how much does it cost to fly on DL from DALLAS to BALTIMORE
SELECT DISTINCT fare.fare_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, flight, flight_fare WHERE (CITY_0.city_code = AIRPORT_SERVICE_0.city_code AND CITY_0.city_name = 'DALLAS' AND CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city...
CREATE TABLE table_17848578_1 ( record VARCHAR, game_site VARCHAR )
What is the record when the game was at the San Diego Stadium?
SELECT record FROM table_17848578_1 WHERE game_site = "San Diego Stadium"
CREATE TABLE table_49258 ( "Date" text, "Home team" text, "Score" text, "Away team" text, "Venue" text, "Box Score" text, "Report" text )
What was the score at North Shore Events Centre?
SELECT "Score" FROM table_49258 WHERE "Venue" = 'north shore events centre'
CREATE TABLE table_5021 ( "Round" real, "Pick" real, "Player" text, "Position" text, "School/Club Team" text )
What is the highest Round that has a Position of Tackle and the Player Fred Neilsen?
SELECT MAX("Round") FROM table_5021 WHERE "Position" = 'tackle' AND "Player" = 'fred neilsen'
CREATE TABLE PostTypes ( Id number, Name text ) CREATE TABLE TagSynonyms ( Id number, SourceTagName text, TargetTagName text, CreationDate time, OwnerUserId number, AutoRenameCount number, LastAutoRename time, Score number, ApprovedByUserId number, ApprovalDate time ) C...
Number of 'identify-this-game' questions given accepted answers more than a month after being asked.
SELECT COUNT(*) FROM Posts AS Questions INNER JOIN Votes ON Votes.PostId = Questions.AcceptedAnswerId WHERE VoteTypeId = 1 AND CAST((JULIANDAY(CreationDate) - JULIANDAY(Questions.CreationDate)) * 24.0 AS INT) > 24 * 28 AND Questions.Tags LIKE '%identify-this-game%'
CREATE TABLE table_10701133_1 ( directed_by VARCHAR, us_viewers__million_ VARCHAR )
Who directed the episode where u.s. viewers (million) is 12.90?
SELECT directed_by FROM table_10701133_1 WHERE us_viewers__million_ = "12.90"
CREATE TABLE table_204_957 ( id number, "year" number, "team" text, "games" number, "combined tackles" number, "tackles" number, "assisted tackles" number, "sacks" number, "forced fumbles" number, "fumble recoveries" number, "fumble return yards" number, "interceptions" n...
what is the fewest number of games coy played for buffalo in one year ?
SELECT MIN("games") FROM table_204_957 WHERE "team" = 'buf'
CREATE TABLE table_name_23 ( ratings VARCHAR, year VARCHAR )
How many Ratings did the 2013 Year have?
SELECT ratings FROM table_name_23 WHERE year = 2013
CREATE TABLE table_68023 ( "Team" text, "Truck(s)" text, "Driver(s)" text, "Primary Sponsor(s)" text, "Owner(s)" text, "Crew Chief" text )
Who is the crew chief, of driver Matt kurzejewski?
SELECT "Crew Chief" FROM table_68023 WHERE "Driver(s)" = 'matt kurzejewski'
CREATE TABLE table_name_33 ( league VARCHAR, home VARCHAR )
What league has a 3-1 home?
SELECT league FROM table_name_33 WHERE home = "3-1"
CREATE TABLE table_name_92 ( outcome VARCHAR, opponent VARCHAR )
The match against Paul-Henri Mathieu had what outcome?
SELECT outcome FROM table_name_92 WHERE opponent = "paul-henri mathieu"
CREATE TABLE table_name_45 ( apparent_magnitude INTEGER, ngc_number INTEGER )
What is the total of Apparent magnitudes for an NGC number larger than 3293?
SELECT SUM(apparent_magnitude) FROM table_name_45 WHERE ngc_number > 3293
CREATE TABLE table_29355 ( "Programs" text, "World" real, "Africa" real, "Americas" real, "Asia" real, "Australasia" real, "Europe" real )
How many times did Australasia received a program if the Americas received 115 program?
SELECT COUNT("Australasia") FROM table_29355 WHERE "Americas" = '115'
CREATE TABLE table_27189 ( "#" real, "Episode" text, "Air Date" text, "Timeslot (EST)" text, "Rating" text, "Share" real, "18-49 (Rating/Share)" text, "Viewers (m)" text, "Weekly Rank (#)" real )
What is the rating for the episode 'in which cooper finds a port in his storm'?
SELECT "Rating" FROM table_27189 WHERE "Episode" = 'In Which Cooper Finds a Port In His Storm'
CREATE TABLE table_29200 ( "model" text, "Speed (GHz)" text, "L3 Cache (MB)" real, "QPI speed (GT/s)" text, "DDR3 Clock (MHz)" real, "TDP (W)" real, "Cores" real, "Threads" real, "Turbo-Boost" text )
How many entries have a speed of exactly 2.53 GHz?
SELECT COUNT("Cores") FROM table_29200 WHERE "Speed (GHz)" = '2.53'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE patient ( uniquepid text, patienthealthsystemstayid number, patientunitstayid number, gender text, age text, ethnicity text, hospitalid num...
tell me the top four frequent input events in 2103?
SELECT t1.celllabel FROM (SELECT intakeoutput.celllabel, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM intakeoutput WHERE intakeoutput.cellpath LIKE '%intake%' AND STRFTIME('%y', intakeoutput.intakeoutputtime) = '2103' GROUP BY intakeoutput.celllabel) AS t1 WHERE t1.c1 <= 4
CREATE TABLE table_571 ( "Club" text, "Played" text, "Won" text, "Drawn" text, "Lost" text, "Points for" text, "Points against" text, "Tries for" text, "Tries against" text, "Try bonus" text, "Losing bonus" text, "Points" text )
What were the drawn with points against at 416?
SELECT "Drawn" FROM table_571 WHERE "Points against" = '416'
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...
what is the primary disease and diagnosis for the patient name miguel hodges?
SELECT demographic.diagnosis, diagnoses.short_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Miguel Hodges"
CREATE TABLE table_name_50 ( result VARCHAR, date VARCHAR )
What was the score on September 1, 1996?
SELECT result FROM table_name_50 WHERE date = "september 1, 1996"
CREATE TABLE table_12184 ( "Draft" text, "Round" text, "Pick" text, "Nationality" text, "Position" text, "College/High School/Club" text )
In which year was the Pick #46?
SELECT "Draft" FROM table_12184 WHERE "Pick" = '46'
CREATE TABLE area ( course_id int, area varchar ) CREATE TABLE ta ( campus_job_id int, student_id int, location varchar ) CREATE TABLE course ( course_id int, name varchar, department varchar, number varchar, credits varchar, advisory_requirement varchar, enforced_requi...
MILSCI 302 name is ?
SELECT DISTINCT name FROM course WHERE department = 'MILSCI' AND number = 302
CREATE TABLE table_name_54 ( surface VARCHAR, place VARCHAR )
Which Surface has a Place of lappeenranta?
SELECT surface FROM table_name_54 WHERE place = "lappeenranta"
CREATE TABLE table_name_73 ( ground VARCHAR, away_team VARCHAR )
What is Ground, when Away Team is Sydney?
SELECT ground FROM table_name_73 WHERE away_team = "sydney"
CREATE TABLE table_name_68 ( location_attendance VARCHAR, date VARCHAR )
What was the location and attendance for the game on December 12?
SELECT location_attendance FROM table_name_68 WHERE date = "december 12"
CREATE TABLE table_name_92 ( first_elected INTEGER, result VARCHAR, incumbent VARCHAR )
What's the average year Charles N. Felton was re-elected?
SELECT AVG(first_elected) FROM table_name_92 WHERE result = "re-elected" AND incumbent = "charles n. felton"
CREATE TABLE table_name_17 ( home_team VARCHAR, venue VARCHAR )
Can you tell me the Home team that has a Venue of Windy Hill?
SELECT home_team FROM table_name_17 WHERE venue = "windy hill"
CREATE TABLE table_15463188_7 ( school_club_team VARCHAR, name VARCHAR )
Nametheh school team for norman gonzales
SELECT school_club_team FROM table_15463188_7 WHERE name = "Norman Gonzales"
CREATE TABLE table_70912 ( "Year" real, "Total Region" real, "Belyando" real, "Broadsound" real, "Nebo" real )
What is the lowest Total Region that has a Year after 2001, and a Broadsound greater than 6,843?
SELECT MIN("Total Region") FROM table_70912 WHERE "Year" > '2001' AND "Broadsound" > '6,843'
CREATE TABLE table_name_52 ( score VARCHAR, attendance VARCHAR )
What is the Score that has an Attendance of 4 679?
SELECT score FROM table_name_52 WHERE attendance = "4 679"
CREATE TABLE competition ( Competition_ID int, Year real, Competition_type text, Country text ) CREATE TABLE player ( Player_ID int, name text, Position text, Club_ID int, Apps real, Tries real, Goals text, Points real ) CREATE TABLE competition_result ( Competition...
I want to know the proportion of the total number for each competition type.
SELECT Competition_type, COUNT(*) FROM competition GROUP BY Competition_type
CREATE TABLE requirement ( requirement_id int, requirement varchar, college varchar ) CREATE TABLE semester ( semester_id int, semester varchar, year int ) CREATE TABLE program_requirement ( program_id int, category varchar, min_credit int, additional_req varchar ) CREATE TABL...
Which courses in Gender , Sexuality , and Premodern China take care of the PreMajor 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 '%Gender , Sexuality , and Premodern China%' OR course.description LIKE '%Gender , Sexuality , and...
CREATE TABLE table_name_35 ( rank VARCHAR, player VARCHAR, titles VARCHAR )
How many rankings are associated with giuseppe meazza holding over 3 titles?
SELECT COUNT(rank) FROM table_name_35 WHERE player = "giuseppe meazza" AND titles > 3
CREATE TABLE lab ( labid number, patientunitstayid number, labname text, labresult number, labresulttime time ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate number, respiration number, systemics...
calculate the number of medications that are prescribed to patient 002-70965 until 42 months ago.
SELECT COUNT(*) FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '002-70965')) AND DATETIME(medication.drugstarttime) <= DATETIME(CURRENT_TIME()...