table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
⌀
CREATE TABLE table_44995 ( "Place" text, "Player" text, "Country" text, "Score" text, "To par" text )
What's the score of Lee Janzen in T4 place?
SELECT "Score" FROM table_44995 WHERE "Place" = 't4' AND "Player" = 'lee janzen'
CREATE TABLE Student_Course_Registrations ( student_id INTEGER, course_id INTEGER, registration_date DATETIME ) CREATE TABLE Addresses ( address_id INTEGER, line_1 VARCHAR(80), line_2 VARCHAR(80), city VARCHAR(50), zip_postcode CHAR(20), state_province_county VARCHAR(50), countr...
Bar graph to show the number of last name from different last name
SELECT last_name, COUNT(last_name) FROM People GROUP BY last_name
CREATE TABLE table_name_39 ( round VARCHAR, competition VARCHAR, club VARCHAR )
Which round is the UEFA Cup Compeition and the Kolkheti-1913 Poti Cub?
SELECT round FROM table_name_39 WHERE competition = "uefa cup" AND club = "kolkheti-1913 poti"
CREATE TABLE table_78813 ( "Election" text, "1st Member" text, "1st Party" text, "2nd Member" text, "2nd Party" text )
What's the party of 2nd member arthur divett hayter when the 1st party is conservative?
SELECT "2nd Party" FROM table_78813 WHERE "1st Party" = 'conservative' AND "2nd Member" = 'arthur divett hayter'
CREATE TABLE table_name_7 ( bowling VARCHAR, player VARCHAR )
What was Min Patel's bowling?
SELECT bowling FROM table_name_7 WHERE player = "min patel"
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...
provide the number of patients whose diagnoses long title is observation for suspected infectious condition and drug type is main?
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.long_title = "Observation for suspected infectious condition" AND prescriptions.drug_type = "MAIN"
CREATE TABLE school ( School_ID int, Grade text, School text, Location text, Type text ) CREATE TABLE driver ( Driver_ID int, Name text, Party text, Home_city text, Age int ) CREATE TABLE school_bus ( School_ID int, Driver_ID int, Years_Working int, If_full_time...
Show the type of school and the number of buses for each type, rank in asc by the total number.
SELECT Type, COUNT(*) FROM school_bus AS T1 JOIN school AS T2 ON T1.School_ID = T2.School_ID GROUP BY T2.Type ORDER BY COUNT(*)
CREATE TABLE table_13549 ( "Team" text, "Outgoing manager" text, "Manner of departure" text, "Date of vacancy" text, "Replaced by" text, "Date of appointment" text, "Position in table" text )
who is the replacement when the team is bournemouth and the outgoing manager is kevin bond?
SELECT "Replaced by" FROM table_13549 WHERE "Team" = 'bournemouth' AND "Outgoing manager" = 'kevin bond'
CREATE TABLE shop ( Shop_ID int, Shop_Name text, Location text, Open_Date text, Open_Year int ) CREATE TABLE stock ( Shop_ID int, Device_ID int, Quantity int ) CREATE TABLE device ( Device_ID int, Device text, Carrier text, Package_Version text, Applications text, ...
What are the names of device shops, and what are the carriers that they carry devices in stock for?
SELECT Carrier, COUNT(Carrier) FROM stock AS T1 JOIN device AS T2 ON T1.Device_ID = T2.Device_ID JOIN shop AS T3 ON T1.Shop_ID = T3.Shop_ID GROUP BY Carrier
CREATE TABLE table_39353 ( "Date" text, "Tournament" text, "Location" text, "Winner" text, "Score" text, "1st prize ( $ )" real )
Which winner had a location of Iowa?
SELECT "Winner" FROM table_39353 WHERE "Location" = 'iowa'
CREATE TABLE labevents ( row_id number, subject_id number, hadm_id number, itemid number, charttime time, valuenum number, valueuom text ) CREATE TABLE d_labitems ( row_id number, itemid number, label text ) CREATE TABLE prescriptions ( row_id number, subject_id number,...
what's the average total cost of the hospital that involves a drug called epinephrine hcl this year?
SELECT AVG(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.hadm_id IN (SELECT prescriptions.hadm_id FROM prescriptions WHERE prescriptions.drug = 'epinephrine hcl') AND DATETIME(cost.chargetime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') GROUP BY cost.hadm_id) AS t1
CREATE TABLE table_27079 ( "Year" real, "Engine" text, "Power" text, "Torque" text, "Transmission" text, "0\u2013100km/h (60mph)" text, "Top speed" text, "CO2" text )
when 0 100km/h (60mph) is 5.8 seconds (5.5), what is the torque?
SELECT "Torque" FROM table_27079 WHERE "0\u2013100km/h (60mph)" = '5.8 seconds (5.5)'
CREATE TABLE table_26269 ( "Local Government Area" text, "Type" text, "Major Town" text, "Land Area (km\u00b2)" text, "Pop. 2006" real, "Density km \u22122" real, "Towns" real, "Est." real )
What was the 2006 population count of the local government area where Coober Pedy is located?
SELECT "Pop. 2006" FROM table_26269 WHERE "Major Town" = 'Coober Pedy'
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time...
how much money did patient 008-26792 have to spend for his hospital stay until 2104?
SELECT SUM(cost.cost) FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '008-26792') AND STRFTIME('%y', cost.chargetime) <= '2104'
CREATE TABLE d_icd_diagnoses ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE labevents ( r...
how many patients were given pericardiocentesis two or more times a year before?
SELECT COUNT(DISTINCT t1.subject_id) FROM (SELECT admissions.subject_id, COUNT(*) AS c1 FROM procedures_icd JOIN admissions ON procedures_icd.hadm_id = admissions.hadm_id WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'pericardiocentesis') ...
CREATE TABLE table_name_49 ( week INTEGER, result VARCHAR )
What's the average Week with the Result l 23 3?
SELECT AVG(week) FROM table_name_49 WHERE result = "l 23–3"
CREATE TABLE table_16387653_1 ( home_team VARCHAR, away_team VARCHAR )
What did the home team score against Richmond?
SELECT home_team AS score FROM table_16387653_1 WHERE away_team = "Richmond"
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 had inj/inf platelet inhibit as the procedure short title?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE procedures.short_title = "Inj/inf platelet inhibit"
CREATE TABLE table_203_292 ( id number, "payload type (pt)" text, "name" text, "type" text, "no. of channels" text, "clock rate (hz)" text, "frame size (ms)" text, "default packet size (ms)" text, "description" text, "references" text )
other than audio , what type of payload types are there ?
SELECT "type" FROM table_203_292 WHERE "type" <> 'audio'
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, draw a bar chart about the distribution of headquarter and the sum of code , and group by attribute headquarter, could you rank y-axis in asc order please?
SELECT T2.Headquarter, T1.Code FROM Products AS T1 JOIN Manufacturers AS T2 ON T1.Manufacturer = T2.Code GROUP BY T2.Headquarter ORDER BY T1.Code
CREATE TABLE catalog_contents_additional_attributes ( catalog_entry_id number, catalog_level_number number, attribute_id number, attribute_value text ) CREATE TABLE catalog_structure ( catalog_level_number number, catalog_id number, catalog_level_name text ) CREATE TABLE catalogs ( cat...
Find the names of all the catalog entries.
SELECT DISTINCT (catalog_entry_name) FROM catalog_contents
CREATE TABLE table_14984078_1 ( date VARCHAR, week VARCHAR )
What was the game date in week 13?
SELECT date FROM table_14984078_1 WHERE week = 13
CREATE TABLE table_50899 ( "Team" text, "Coach" text, "Home Ground" text, "Location" text, "Founded" text )
What is the location of South Adelaide?
SELECT "Location" FROM table_50899 WHERE "Team" = 'south adelaide'
CREATE TABLE table_name_67 ( total_enrollment VARCHAR, institution_name VARCHAR )
What is Howard Payne University's total enrollment?
SELECT total_enrollment FROM table_name_67 WHERE institution_name = "howard payne university"
CREATE TABLE table_13725 ( "Protocol" text, "Power Line" text, "Radio-Frequency" text, "Open Source?" text, "Needs Neutral Wire?" text )
Does it need neutral wire when the power line and open source are no?
SELECT "Needs Neutral Wire?" FROM table_13725 WHERE "Power Line" = 'no' AND "Open Source?" = 'no'
CREATE TABLE Has_Allergy ( StuID INTEGER, Allergy VARCHAR(20) ) CREATE TABLE Allergy_Type ( Allergy VARCHAR(20), AllergyType VARCHAR(20) ) CREATE TABLE Student ( StuID INTEGER, LName VARCHAR(12), Fname VARCHAR(12), Age INTEGER, Sex VARCHAR(1), Major INTEGER, Advisor INTEGER...
A bar chart about what are the average ages for male and female students?, and order y axis in desc order.
SELECT Sex, AVG(Age) FROM Student GROUP BY Sex ORDER BY AVG(Age) DESC
CREATE TABLE table_name_53 ( series VARCHAR, date VARCHAR )
what series was on may 14
SELECT series FROM table_name_53 WHERE date = "may 14"
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE labevents ...
how much hydromorphone (dilaudid) has been prescribed in their first hospital encounter to patient 26995 overall?
SELECT SUM(prescriptions.dose_val_rx) FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 26995 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'hydromorphone (dilaudid)'
CREATE TABLE table_203_67 ( id number, "place" number, "team" text, "played" number, "won" number, "draw" number, "lost" number, "goals\nscored" number, "goals\nconceded" number, "+/-" number, "points" number )
which team earned more than 30 points besides c.d. fas ?
SELECT "team" FROM table_203_67 WHERE "points" > 30 AND "team" <> 'c.d. fas'
CREATE TABLE d_icd_procedures ( row_id number, icd9_code text, short_title text, long_title text ) CREATE TABLE inputevents_cv ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, amount number ) CREATE TABLE cost ( row_i...
during the last hospital visit what is the health insurance of patient 44625?
SELECT admissions.insurance FROM admissions WHERE admissions.subject_id = 44625 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime DESC LIMIT 1
CREATE TABLE Ref_Locations ( Location_Code CHAR(15), Location_Name VARCHAR(255), Location_Description VARCHAR(255) ) CREATE TABLE All_Documents ( Document_ID INTEGER, Date_Stored DATETIME, Document_Type_Code CHAR(15), Document_Name CHAR(255), Document_Description CHAR(255), Other_De...
Show all role codes and the number of employees in each role. Show a pie chart.
SELECT Role_Code, COUNT(*) FROM Employees GROUP BY Role_Code
CREATE TABLE table_name_84 ( height VARCHAR, name VARCHAR, built VARCHAR, rank VARCHAR, floors VARCHAR )
What is Height, when Rank is less than 20, when Floors is greater than 9, when Built is 2005, and when Name is The Edge (C)?
SELECT height FROM table_name_84 WHERE rank < 20 AND floors > 9 AND built = 2005 AND name = "the edge (c)"
CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE d_...
how many hours have passed since the last time patient 14467 was given a d10w intake on the current icu visit?
SELECT 24 * (STRFTIME('%j', CURRENT_TIME()) - STRFTIME('%j', inputevents_cv.charttime)) FROM inputevents_cv WHERE inputevents_cv.icustay_id IN (SELECT icustays.icustay_id FROM icustays WHERE icustays.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 14467) AND icustays.outtime IS NULL)...
CREATE TABLE table_name_91 ( state VARCHAR, host VARCHAR )
What state is the University of Tennessee located in?
SELECT state FROM table_name_91 WHERE host = "university of tennessee"
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...
provide the number of patients whose lab test name is iron?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.label = "Iron"
CREATE TABLE Street_Markets ( Market_ID INTEGER, Market_Details VARCHAR(255) ) CREATE TABLE Hotels ( hotel_id INTEGER, star_rating_code CHAR(15), pets_allowed_yn CHAR(1), price_range real, other_hotel_details VARCHAR(255) ) CREATE TABLE Visitors ( Tourist_ID INTEGER, Tourist_Detail...
Show the names and ids of tourist attractions that are visited at least two times Visualize by bar chart, I want to list in descending by the bars.
SELECT T1.Name, T1.Tourist_Attraction_ID FROM Tourist_Attractions AS T1 JOIN Visits AS T2 ON T1.Tourist_Attraction_ID = T2.Tourist_Attraction_ID ORDER BY T1.Name DESC
CREATE TABLE Faculty_Participates_in ( FacID INTEGER, actid INTEGER ) 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 Activity ( actid INTEGER, a...
Create a bar chart showing the total number across sex, could you order in desc by the Sex?
SELECT Sex, COUNT(*) FROM Faculty GROUP BY Sex ORDER BY Sex DESC
CREATE TABLE table_69674 ( "Order" text, "Minister" text, "Party" text, "Prime Minister" text, "Title" text, "Term start" text, "Term end" text, "Term in office" text )
What was Parker Moloney's party affiliation when he was the Minister for Markets?
SELECT "Party" FROM table_69674 WHERE "Minister" = 'parker moloney' AND "Title" = 'minister for markets'
CREATE TABLE table_1342379_23 ( district VARCHAR, candidates VARCHAR )
what's the district with candidates being john e. rankin (d) unopposed
SELECT district FROM table_1342379_23 WHERE candidates = "John E. Rankin (D) Unopposed"
CREATE TABLE cite ( citingpaperid int, citedpaperid int ) CREATE TABLE keyphrase ( keyphraseid int, keyphrasename varchar ) CREATE TABLE paperfield ( fieldid int, paperid int ) CREATE TABLE paperdataset ( paperid int, datasetid int ) CREATE TABLE paperkeyphrase ( paperid int, ...
character recognition papers from before 2010
SELECT DISTINCT paper.paperid FROM keyphrase, paper, paperkeyphrase WHERE keyphrase.keyphrasename = 'character recognition' AND paperkeyphrase.keyphraseid = keyphrase.keyphraseid AND paper.paperid = paperkeyphrase.paperid AND paper.year < 2010
CREATE TABLE table_10122 ( "Rank" real, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
For ranks over 2 with Golds over 6 and Silvers over 5 what would be the lowest qualifying Total?
SELECT MIN("Total") FROM table_10122 WHERE "Gold" > '6' AND "Rank" > '2' AND "Silver" > '5'
CREATE TABLE microlab ( microlabid number, patientunitstayid number, culturesite text, organism text, culturetakentime time ) CREATE TABLE diagnosis ( diagnosisid number, patientunitstayid number, diagnosisname text, diagnosistime time, icd9code text ) CREATE TABLE allergy ( ...
among the patients of age 40s in 2104 what are the top four most frequent diagnoses?
SELECT t1.diagnosisname FROM (SELECT diagnosis.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnosis WHERE diagnosis.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 40 AND 49) AND STRFTIME('%y', diagnosis.diagnosistime) = '2104' GROUP BY diagnosis.d...
CREATE TABLE table_name_52 ( game INTEGER, date VARCHAR )
What is the game number held on May 20?
SELECT AVG(game) FROM table_name_52 WHERE date = "may 20"
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE diagnoses_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE cost ( row_id number, subject_id...
how many patients had received atrial cardioversion until 2102?
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT procedures_icd.hadm_id FROM procedures_icd WHERE procedures_icd.icd9_code = (SELECT d_icd_procedures.icd9_code FROM d_icd_procedures WHERE d_icd_procedures.short_title = 'atrial cardioversion') AND STRFTIME('%y', procedures...
CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE vitalperiodic ( vitalperiodicid number, patientunitstayid number, temperature number, sao2 number, heartrate n...
when was first time the respiration of patient 035-166 was less than 3.0 on the last intensive care unit visit?
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 = '035-166') AND NOT patient.unitdischargetime IS NULL...
CREATE TABLE table_204_964 ( id number, "team" text, "seasons" number, "games" number, "wins" number, "ties" number, "losses" number, "goals\nfor" number, "goals\nagainst" number, "goal\ndiff" number, "points" number )
which team played the same amount of seasons as the canadiens ?
SELECT "team" FROM table_204_964 WHERE "team" <> 'montreal canadiens' AND "seasons" = (SELECT "seasons" FROM table_204_964 WHERE "team" = 'montreal canadiens')
CREATE TABLE Suppliers ( supplier_id INTEGER, supplier_name VARCHAR(80), supplier_phone VARCHAR(80) ) CREATE TABLE Order_Items ( order_item_id INTEGER, order_id INTEGER, product_id INTEGER ) CREATE TABLE Products ( product_id INTEGER, product_type_code VARCHAR(10), product_name VAR...
Give the maximum product price for each product type in a bar chart, and sort bar in descending order.
SELECT product_type_code, MAX(product_price) FROM Products GROUP BY product_type_code ORDER BY product_type_code DESC
CREATE TABLE table_74006 ( "District" text, "Incumbent" text, "Party" text, "First elected" real, "Result" text, "Candidates" text )
Name the least first elected
SELECT MIN("First elected") FROM table_74006
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 ( Scho...
Visualize a bar chart about the distribution of Team_Name and School_ID , and display in desc by the Y-axis.
SELECT Team_Name, School_ID FROM basketball_match ORDER BY School_ID DESC
CREATE TABLE flight_leg ( flight_id int, leg_number int, leg_flight int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE flight_stop ( flight_id int, stop_number i...
show me nonstop flights from MIAMI to NEW YORK with COACH class fares
SELECT DISTINCT flight.flight_id FROM airport_service AS AIRPORT_SERVICE_0, airport_service AS AIRPORT_SERVICE_1, city AS CITY_0, city AS CITY_1, fare, fare_basis, flight, flight_fare WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'NEW YORK' AND fare_basis.class_type = 'COACH' AND fare.fa...
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 lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text,...
how many patients having government insurance have had ammonia lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.insurance = "Government" AND lab.label = "Ammonia"
CREATE TABLE table_73751 ( "Character" text, "English version" text, "Laserdisc edition" text, "Buena Vista edition" text, "Special edition" text )
who is the character where the special edition is koichi sakaguchi?
SELECT "Character" FROM table_73751 WHERE "Special edition" = 'Koichi Sakaguchi'
CREATE TABLE SuggestedEdits ( Id number, PostId number, CreationDate time, ApprovalDate time, RejectionDate time, OwnerUserId number, Comment text, Text text, Title text, Tags text, RevisionGUID other ) CREATE TABLE PostFeedback ( Id number, PostId number, IsAnon...
How close am I to the Proofreader badge?. Proofreader requires 100 approvals+rejections, so your distance away is (100 - approvals - rejections).
SELECT * FROM SuggestedEditVotes WHERE UserId = @UserId
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 ...
what is the maximum days of hospital stay of patients whose primary disease is pituitary bleed?
SELECT MAX(demographic.days_stay) FROM demographic WHERE demographic.diagnosis = "PITUITARY BLEED"
CREATE TABLE table_6403 ( "Year" real, "Country" text, "Song" text, "Artist" text, "Written by" text )
In what year was the artist Afro-dite?
SELECT "Year" FROM table_6403 WHERE "Artist" = 'afro-dite'
CREATE TABLE table_13854 ( "Date" text, "Label" text, "Format" text, "Country" text, "Catalog" text )
What format was the release in form the Edsel label, and that was from the EDCD 262 catalog?
SELECT "Format" FROM table_13854 WHERE "Label" = 'edsel' AND "Catalog" = 'edcd 262'
CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime time ) CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime t...
list the top four most frequent procedures that patients have received during the same month after they have been diagnosed with pleural effusion - transudate by lab analysis until 1 year ago.
SELECT t3.treatmentname FROM (SELECT t2.treatmentname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'pleural effusion - transudate by lab ana...
CREATE TABLE table_name_80 ( Group VARCHAR, song VARCHAR )
What is Group Song, when Song is ?
SELECT Group AS song FROM table_name_80 WHERE song = "换季"
CREATE TABLE table_72885 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who had the high point total against cleveland?
SELECT "High points" FROM table_72885 WHERE "Team" = 'Cleveland'
CREATE TABLE table_63184 ( "City of license" text, "Identifier" text, "Frequency" text, "Power" text, "Class" text, "RECNet" text )
What's the frequency when the identifier is cbf-fm-9?
SELECT "Frequency" FROM table_63184 WHERE "Identifier" = 'cbf-fm-9'
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE ReviewTaskTypes ( Id number, Name text, Description text ) CRE...
All posts from Jan 1, 2019.
SELECT * FROM Posts WHERE CreationDate >= '2019-03-25'
CREATE TABLE table_name_13 ( byes INTEGER, losses VARCHAR, wins VARCHAR )
What is the average number of Byes for the team that had 15 Losses, and less than 1 Win?
SELECT AVG(byes) FROM table_name_13 WHERE losses = 15 AND wins < 1
CREATE TABLE table_name_66 ( actor VARCHAR, character VARCHAR )
What actor plays glen cole?
SELECT actor FROM table_name_66 WHERE character = "glen cole"
CREATE TABLE patients ( row_id number, subject_id number, gender text, dob time, dod 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 diagnoses_icd ( ...
calculate the four year survival rate among the patients who were prescribed with prasugrel after having been diagnosed with klebsiella pneumoniae.
SELECT SUM(CASE WHEN patients.dod IS NULL THEN 1 WHEN STRFTIME('%j', patients.dod) - STRFTIME('%j', t4.charttime) > 4 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.subject_id, t2.charttime FROM (SELECT t1.subject_id, t1.charttime FROM (SELECT admissions.subject_id, diagnoses_icd.charttime FROM diagnoses_icd...
CREATE TABLE PostNotices ( Id number, PostId number, PostNoticeTypeId number, CreationDate time, DeletionDate time, ExpiryDate time, Body text, OwnerUserId number, DeletionUserId number ) CREATE TABLE Comments ( Id number, PostId number, Score number, Text text, ...
Users with most posts in top 1000.
WITH CTE_TopPosts AS (SELECT OwnerUserId FROM Posts ORDER BY Score DESC LIMIT 100000) SELECT OwnerUserId, DisplayName, COUNT(OwnerUserId) AS Count FROM CTE_TopPosts JOIN Users ON CTE_TopPosts.OwnerUserId = Users.Id GROUP BY OwnerUserId, DisplayName ORDER BY Count DESC LIMIT 1000
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE demographic (...
what is the diagnosis code and diagnosis long title for the patient francis baseler?
SELECT diagnoses.icd9_code, diagnoses.long_title FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.name = "Francis Baseler"
CREATE TABLE PostHistoryTypes ( Id number, Name text ) CREATE TABLE Tags ( Id number, TagName text, Count number, ExcerptPostId number, WikiPostId number ) CREATE TABLE PendingFlags ( Id number, FlagTypeId number, PostId number, CreationDate time, CloseReasonTypeId numb...
Question length and score distributions.
WITH Keyed AS (SELECT CAST(Posts.Score AS FLOAT) AS Score, POWER(ROUND(SQRT(LENGTH(Body)), 0), 2) AS PostLength FROM Posts WHERE PostTypeId = 1), Sized AS (SELECT PostLength, AVG(Score) AS MeanScore, COUNT(Score) AS ClusterSize FROM Keyed GROUP BY PostLength) SELECT PostLength, MeanScore, ClusterSize FROM Sized WHERE C...
CREATE TABLE Product_Categories ( production_type_code VARCHAR(15), product_type_description VARCHAR(80), vat_rating DECIMAL(19,4) ) CREATE TABLE Invoice_Line_Items ( order_item_id INTEGER, invoice_number INTEGER, product_id INTEGER, product_title VARCHAR(80), product_quantity VARCHAR(5...
Display a pie chart for what are the first names and ids for customers who have two or more accounts?
SELECT T2.customer_first_name, T1.customer_id FROM Accounts AS T1 JOIN Customers AS T2 ON T1.customer_id = T2.customer_id
CREATE TABLE table_name_96 ( team__number2 VARCHAR )
What is 2nd Leg, when Team #2 is 'San Lorenzo'?
SELECT 2 AS nd_leg FROM table_name_96 WHERE team__number2 = "san lorenzo"
CREATE TABLE table_68070 ( "School" text, "Team" text, "Division Record" text, "Overall Record" text, "Season Outcome" text )
Name the school for eagles
SELECT "School" FROM table_68070 WHERE "Team" = 'eagles'
CREATE TABLE table_2562572_46 ( settlement VARCHAR, cyrillic_name_other_names VARCHAR )
Which settlement has a cyrillic and other name of (romanian: voivodin )?
SELECT settlement FROM table_2562572_46 WHERE cyrillic_name_other_names = "Војводинци (Romanian: Voivodinţ)"
CREATE TABLE requirement ( requirement_id int, requirement varchar, college 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, admit_term int,...
What is the actual name of ELI 530 ?
SELECT DISTINCT name FROM course WHERE department = 'ELI' AND number = 530
CREATE TABLE table_18041 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real, "U.S. viewers (millions)" text )
Which episode was watched by 11.75 million U.S. viewers?
SELECT "Title" FROM table_18041 WHERE "U.S. viewers (millions)" = '11.75'
CREATE TABLE table_44260 ( "Rank" text, "Nation" text, "Gold" real, "Silver" real, "Bronze" real, "Total" real )
Who scored the lowest with 8 gold medals and less than 4 silver medals?
SELECT MIN("Total") FROM table_44260 WHERE "Gold" = '8' AND "Silver" < '4'
CREATE TABLE table_38253 ( "Election" text, "D\u00e1il" text, "Share of votes" text, "Seats" real, "Government" text )
What is the 6th dail share of votes?
SELECT "Share of votes" FROM table_38253 WHERE "D\u00e1il" = '6th'
CREATE TABLE table_49713 ( "Model number" text, "Frequency" text, "L2 cache" text, "Mult." text, "Voltage" text, "Socket" text )
What is Frequency, when Model Number is Pentium II 400?
SELECT "Frequency" FROM table_49713 WHERE "Model number" = 'pentium ii 400'
CREATE TABLE table_18600760_8 ( township VARCHAR, county VARCHAR )
Name the township for kidder
SELECT township FROM table_18600760_8 WHERE county = "Kidder"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, itemid text, charttime text, flag text, value_unit text, label text, fluid text ) CREATE TABLE prescriptions...
find the diagnosis icd9 code of subject id 2560.
SELECT diagnoses.icd9_code FROM diagnoses WHERE diagnoses.subject_id = "2560"
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 year of birth is less than 2058 and diagnoses short title is stevens-johnson-ten syn?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.dob_year < "2058" AND diagnoses.short_title = "Stevens-Johnson-TEN syn"
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...
provide me the number of patients who have abnormal lab test status and diagnosed for the need for prophylactic vaccination and inoculation against viral hepatitis.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE diagnoses.short_title = "Need prphyl vc vrl hepat" AND lab.flag = "abnormal"
CREATE TABLE table_15398 ( "Date" text, "Opponent" text, "Site" text, "Score" text, "Loss" text )
What was the score of the game when there was a loss of Kern (0-2)?
SELECT "Score" FROM table_15398 WHERE "Loss" = 'kern (0-2)'
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 gsi ( course_offering_id int, student_id int ) CREATE TABLE semester ( ...
Which CHEMBIO courses require 530 ?
SELECT DISTINCT COURSE_1.department, COURSE_1.name, COURSE_1.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND COURSE_0.department = 'CHEMBIO' AND COURSE_0.number = 530 AND COURSE_1.course_id = course_prerequisite.course_id
CREATE TABLE table_23892 ( "School" text, "Location(s)" text, "Control" text, "Type" text, "Enrollment (2009)" real, "Founded" real )
When was Southern Vermont College founded?
SELECT MAX("Founded") FROM table_23892 WHERE "School" = 'Southern Vermont College'
CREATE TABLE table_74526 ( "Year" real, "Tournaments played" real, "Cuts made*" real, "Wins" real, "Top 10s" real, "Best finish" text, "Earnings ( $ )" text, "Scoring average" real )
Tell me the scoring average for year less than 1998 and wins more than 3
SELECT "Scoring average" FROM table_74526 WHERE "Year" < '1998' AND "Wins" > '3'
CREATE TABLE table_name_77 ( winning_constructor VARCHAR, fastest_lap VARCHAR, grand_prix VARCHAR )
Name the winning constructor for when the fastest lap was mark webber at the malaysian grand prix
SELECT winning_constructor FROM table_name_77 WHERE fastest_lap = "mark webber" AND grand_prix = "malaysian grand prix"
CREATE TABLE table_1601027_1 ( earpads VARCHAR, headphone_class VARCHAR, us_msrp VARCHAR )
How many values for earpads correspond to the headphone class Prestige and a US MSRP of $79?
SELECT COUNT(earpads) FROM table_1601027_1 WHERE headphone_class = "Prestige" AND us_msrp = "$79"
CREATE TABLE table_name_71 ( first_season INTEGER, wins VARCHAR, seasons VARCHAR )
What is the total of First Season games with 1537 Wins and a Season greater than 109?
SELECT SUM(first_season) FROM table_name_71 WHERE wins = 1537 AND seasons > 109
CREATE TABLE table_name_98 ( away_team VARCHAR, home_team VARCHAR )
When the home team was geelong, what did the away team score?
SELECT away_team AS score FROM table_name_98 WHERE home_team = "geelong"
CREATE TABLE table_30580 ( "Pick #" real, "Player" text, "Position" text, "Nationality" text, "NHL team" text, "College/junior/club team" text )
How many college/junior/club teams are ther when nhl team is edmonton oilers?
SELECT COUNT("College/junior/club team") FROM table_30580 WHERE "NHL team" = 'Edmonton Oilers'
CREATE TABLE table_name_87 ( date VARCHAR, home_team VARCHAR )
What day is st kilda the home side?
SELECT date FROM table_name_87 WHERE home_team = "st kilda"
CREATE TABLE table_29108 ( "Series #" real, "Season #" real, "Title" text, "Director" text, "Writer" text, "Original Airdate" text )
What is the first series episode number for 'the christmas watch'?
SELECT MIN("Series #") FROM table_29108 WHERE "Title" = 'The Christmas Watch'
CREATE TABLE table_38013 ( "Name" text, "Life" text, "Age at death" text, "First contact with Hitler" text, "Relationship" text )
What is the relationship of the woman who died at 96?
SELECT "Relationship" FROM table_38013 WHERE "Age at death" = '96'
CREATE TABLE table_3955 ( "Code" text, "District" text, "Headquarters" text, "Population (2001 Census)" real, "Population (2011 Census)" real, "Area (km\u00b2)" real, "Density in 2011 (/km\u00b2)" text )
How many people lived in the district whose headquarters is in Bhubaneswar in 2001?
SELECT "Population (2001 Census)" FROM table_3955 WHERE "Headquarters" = 'Bhubaneswar'
CREATE TABLE table_11545282_4 ( years_for_jazz VARCHAR, no VARCHAR )
What years did number 54 play for the jazz
SELECT years_for_jazz FROM table_11545282_4 WHERE no = 54
CREATE TABLE ReviewTaskResults ( Id number, ReviewTaskId number, ReviewTaskResultTypeId number, CreationDate time, RejectionReasonId number, Comment text ) CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId ...
Tags and Posts for Each Year.
SELECT T.TagName AS "tag", TIME_TO_STR(CreationDate, '%Y') AS "year", COUNT(PT.PostId) AS "number_of_posts" FROM Tags AS T, PostTags AS PT, Posts AS P WHERE T.Id = PT.TagId AND P.Id = PT.PostId GROUP BY T.TagName, TIME_TO_STR(CreationDate, '%Y') ORDER BY TIME_TO_STR(CreationDate, '%Y')
CREATE TABLE table_33004 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the venue when melbourne is the away team?
SELECT "Venue" FROM table_33004 WHERE "Away team" = 'melbourne'
CREATE TABLE table_name_31 ( geohash_length INTEGER, lng_error VARCHAR, lng_bits VARCHAR )
What is the highest geohash length when there is a ng error of 0.00017, and a lng bits smaller than 20?
SELECT MAX(geohash_length) FROM table_name_31 WHERE lng_error = "±0.00017" AND lng_bits < 20
CREATE TABLE table_51530 ( "Feb 2010" text, "Mar 2010" text, "May 2010" real, "Jun 2010" real, "Jul 2010" real, "Aug 2010" real, "Sep 2010" real, "Oct 2010" real, "Nov 2010" real, "Dec 2010" real, "Jan 2011" real, "Feb 2011" real, "Mar 2011" real, "Apr 2011" real,...
What is the average Feb 2013 with a Feb 2010 with 37, and a Nov 2012 less than 32?
SELECT AVG("Feb 2013") FROM table_51530 WHERE "Feb 2010" = '37' AND "Nov 2012" < '32'
CREATE TABLE table_name_70 ( score VARCHAR, surface VARCHAR, rank VARCHAR )
What was the score of the match played on hard with a person ranked 10?
SELECT score FROM table_name_70 WHERE surface = "hard" AND rank = 10
CREATE TABLE table_name_86 ( away_team VARCHAR )
When the away team was collingwood, what was the away team score?
SELECT away_team AS score FROM table_name_86 WHERE away_team = "collingwood"