table
stringlengths
33
7.14k
question
stringlengths
4
1.06k
output
stringlengths
2
4.44k
CREATE TABLE table_name_7 ( laps VARCHAR, constructor VARCHAR, driver VARCHAR )
How many laps were there when the constructor was Renault, and when the Driver was Fernando Alonso?
SELECT laps FROM table_name_7 WHERE constructor = "renault" AND driver = "fernando alonso"
CREATE TABLE table_name_94 ( haat VARCHAR, city_of_license VARCHAR )
what is the HAAT of devils lake
SELECT haat FROM table_name_94 WHERE city_of_license = "devils lake"
CREATE TABLE table_2850912_12 ( college_junior_club_team VARCHAR, nhl_team VARCHAR )
To which organziation does the winnipeg jets belong to?
SELECT college_junior_club_team FROM table_2850912_12 WHERE nhl_team = "Winnipeg Jets"
CREATE TABLE table_36868 ( "Name" text, "Faith" text, "Type" text, "Intake" real, "DCSF number" real, "Ofsted number" real )
What is the lowest Ofsted number for a primary with a CE faith, intake of 30 and a DCSF number lower than 3349?
SELECT MIN("Ofsted number") FROM table_36868 WHERE "Type" = 'primary' AND "Faith" = 'ce' AND "Intake" = '30' AND "DCSF number" < '3349'
CREATE TABLE table_name_21 ( state VARCHAR, royal_house VARCHAR, name VARCHAR )
What state had the name of wu for the royal house of ji?
SELECT state FROM table_name_21 WHERE royal_house = "ji" AND name = "wu"
CREATE TABLE diagnoses ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE procedures ( subject_id text, hadm_id text, icd9_code text, short_title text, long_title text ) CREATE TABLE lab ( subject_id text, hadm_id text, ...
provide the number of patients whose gender is m and procedure icd9 code is 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_37 ( runner_s__up VARCHAR, date VARCHAR )
Who is Runner(s)-up that has a Date of may 24, 1999?
SELECT runner_s__up FROM table_name_37 WHERE date = "may 24, 1999"
CREATE TABLE table_21884 ( "Season" text, "Date" text, "Driver" text, "Team" text, "Chassis" text, "Engine" text, "Laps" text, "Miles (km)" text, "Race Time" text, "Average Speed (mph)" text, "Report" text )
When 1:34:01 is the race time what is the miles in kilometers?
SELECT "Miles (km)" FROM table_21884 WHERE "Race Time" = '1:34:01'
CREATE TABLE table_204_54 ( id number, "pondicherry assembly" text, "duration" text, "name of m.l.a." text, "party affiliation" text, "election year" number )
what party is represented the most ?
SELECT "party affiliation" FROM table_204_54 GROUP BY "party affiliation" ORDER BY COUNT(*) DESC LIMIT 1
CREATE TABLE table_59220 ( "Physical property" text, "Helium" text, "Neon" text, "Argon" text, "Krypton" text, "Xenon" text )
Which Krypton has a Physical property of critical pressure (atm)?
SELECT "Krypton" FROM table_59220 WHERE "Physical property" = 'critical pressure (atm)'
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...
what were the four most commonly prescribed drugs for patients 20s since 2100?
SELECT t1.drugname FROM (SELECT medication.drugname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM medication WHERE medication.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.age BETWEEN 20 AND 29) AND STRFTIME('%y', medication.drugstarttime) >= '2100' GROUP BY medication.drugn...
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE countries ( COUNTRY_ID varchar(2), COUNTRY_NAME varchar(40), REGION_ID decimal(10,0) ) CREATE TABLE locations ( LOCATION_ID decimal(4,0...
For those employees who did not have any job in the past, a bar chart shows the distribution of job_id and the sum of manager_id , and group by attribute job_id, order Y-axis in desc order please.
SELECT JOB_ID, SUM(MANAGER_ID) FROM employees WHERE NOT EMPLOYEE_ID IN (SELECT EMPLOYEE_ID FROM job_history) GROUP BY JOB_ID ORDER BY SUM(MANAGER_ID) DESC
CREATE TABLE table_15030 ( "Year" real, "Entrant" text, "Chassis" text, "Engine" text, "Points" real )
What is the latest year with more than 0 points?
SELECT MAX("Year") FROM table_15030 WHERE "Points" > '0'
CREATE TABLE allergy ( allergyid number, patientunitstayid number, drugname text, allergyname text, allergytime time ) CREATE TABLE medication ( medicationid number, patientunitstayid number, drugname text, dosage text, routeadmin text, drugstarttime time, drugstoptime t...
tell me the procedure that patient 027-8953 last had during the last year?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '027-8953')) AND DATETIME(treatment.treatmenttime, 'start of year'...
CREATE TABLE student_record ( student_id int, course_id int, semester int, grade varchar, how varchar, transfer_source varchar, earn_credit varchar, repeat_term varchar, test_id varchar ) CREATE TABLE instructor ( instructor_id int, name varchar, uniqname varchar ) CREA...
In Spring and Summer term how many 200 -level classes are being offered ?
SELECT COUNT(DISTINCT course.course_id, semester.semester) FROM course, course_offering, semester WHERE course.course_id = course_offering.course_id AND course.department = 'department0' AND course.number BETWEEN 200 AND 200 + 100 AND semester.semester IN ('SP', 'SS', 'SU') AND semester.semester_id = course_offering.se...
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 maximum age of patients whose admission type is urgent and insurance is medicare?
SELECT MAX(demographic.age) FROM demographic WHERE demographic.admission_type = "URGENT" AND demographic.insurance = "Medicare"
CREATE TABLE outputevents ( row_id number, subject_id number, hadm_id number, icustay_id number, charttime time, itemid number, value number ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE c...
what were the top three most frequently performed procedures that the patient received within the same hospital visit after diagnosis of fx dorsal vertebra-close until 2102?
SELECT d_icd_procedures.short_title FROM d_icd_procedures WHERE d_icd_procedures.icd9_code IN (SELECT t3.icd9_code FROM (SELECT t2.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT admissions.subject_id, diagnoses_icd.charttime, admissions.hadm_id FROM diagnoses_icd JOIN admissions ON diagnoses_i...
CREATE TABLE table_name_41 ( condition VARCHAR, partial_thromboplastin_time VARCHAR, bleeding_time VARCHAR )
I want the condition that has a partial thromboplastin time of prolonged and unaffected bleeding time
SELECT condition FROM table_name_41 WHERE partial_thromboplastin_time = "prolonged" AND bleeding_time = "unaffected"
CREATE TABLE table_3988 ( "No. in series" real, "No. in season" real, "Title" text, "Directed by" text, "Written by" text, "Original air date" text, "Production code" real )
What number episode in the series was titled 'Best Laid Plans'?
SELECT MAX("No. in series") FROM table_3988 WHERE "Title" = 'Best Laid Plans'
CREATE TABLE table_72550 ( "PowerShell (Cmdlet)" text, "PowerShell (Alias)" text, "CMD.EXE / COMMAND.COM" text, "Unix shell" text, "Description" text )
How many values of powershell (cmdlet) are valid when unix shell is env, export, set, setenv?
SELECT COUNT("PowerShell (Cmdlet)") FROM table_72550 WHERE "Unix shell" = 'env, export, set, setenv'
CREATE TABLE organizations ( organization_id number, parent_organization_id number, organization_details text ) CREATE TABLE timed_locations_of_things ( thing_id number, date_and_time time, location_code text ) CREATE TABLE customer_events ( customer_event_id number, customer_id number...
What are the resident details containing the substring 'Miss'?
SELECT other_details FROM residents WHERE other_details LIKE '%Miss%'
CREATE TABLE table_name_38 ( date VARCHAR, fastest_lap VARCHAR )
On what date did Gunnar Nilsson make the fastest lap?
SELECT date FROM table_name_38 WHERE fastest_lap = "gunnar nilsson"
CREATE TABLE table_72461 ( "Game" real, "Date" text, "Team" text, "Score" text, "High points" text, "High rebounds" text, "High assists" text, "Location Attendance" text, "Record" text )
Who was the high rebounder against charlotte?
SELECT "High rebounds" FROM table_72461 WHERE "Team" = 'Charlotte'
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 All_Home and School_ID , and group by attribute ACC_Road, and rank in desc by the x axis.
SELECT All_Home, School_ID FROM basketball_match GROUP BY ACC_Road, All_Home ORDER BY All_Home DESC
CREATE TABLE table_65307 ( "World record" text, "Snatch" text, "Chen Yanqing ( CHN )" text, "111kg" text, "Doha , Qatar" text )
What is the Doha, Qatar when the snatch is clean & jerk?
SELECT "Doha , Qatar" FROM table_65307 WHERE "Snatch" = 'clean & jerk'
CREATE TABLE table_14720 ( "Game" real, "Date" text, "Location" text, "Time" text, "Attendance" real )
If time is 2:13 and attendance is less than 56,335, what is the largest game number?
SELECT MAX("Game") FROM table_14720 WHERE "Attendance" < '56,335' AND "Time" = '2:13'
CREATE TABLE job_history ( EMPLOYEE_ID decimal(6,0), START_DATE date, END_DATE date, JOB_ID varchar(10), DEPARTMENT_ID decimal(4,0) ) CREATE TABLE departments ( DEPARTMENT_ID decimal(4,0), DEPARTMENT_NAME varchar(30), MANAGER_ID decimal(6,0), LOCATION_ID decimal(4,0) ) CREATE TABLE...
For those employees who was hired before 2002-06-21, show me about the distribution of hire_date and the sum of employee_id bin hire_date by weekday in a bar chart, list by the total number in descending.
SELECT HIRE_DATE, SUM(EMPLOYEE_ID) FROM employees WHERE HIRE_DATE < '2002-06-21' ORDER BY SUM(EMPLOYEE_ID) DESC
CREATE TABLE table_name_96 ( name VARCHAR, launched_by VARCHAR, propulsion VARCHAR, year VARCHAR )
What is the name of the anti-ship missile that had a turbojet propulsion that was launched by a surface, sub after 1985?
SELECT name FROM table_name_96 WHERE propulsion = "turbojet" AND year > 1985 AND launched_by = "surface, sub"
CREATE TABLE table_47581 ( "Year (Ceremony)" text, "Film title used in nomination" text, "Original title" text, "Primary Language(s)" text, "Director" text, "Result" text )
What is Director, when Original Title is 'Sah '?
SELECT "Director" FROM table_47581 WHERE "Original title" = 'sahə'
CREATE TABLE table_66035 ( "Tie no" text, "Home team" text, "Score" text, "Away team" text, "Date" text )
What is the game score when the tie no is 7?
SELECT "Score" FROM table_66035 WHERE "Tie no" = '7'
CREATE TABLE table_23512864_4 ( winning_party_coalition VARCHAR, election_year VARCHAR )
Who is the winning party/coalition name in election year 1980?
SELECT winning_party_coalition FROM table_23512864_4 WHERE election_year = 1980
CREATE TABLE table_name_68 ( player VARCHAR, round VARCHAR, position VARCHAR )
After Round 5, which player was drafted for Defensive Tackle?
SELECT player FROM table_name_68 WHERE round > 5 AND position = "defensive tackle"
CREATE TABLE table_name_87 ( round INTEGER, player VARCHAR )
What is the largest round number for Dan Connor, the player?
SELECT MAX(round) FROM table_name_87 WHERE player = "dan connor"
CREATE TABLE Reservations ( Code INTEGER, Room TEXT, CheckIn TEXT, CheckOut TEXT, Rate REAL, LastName TEXT, FirstName TEXT, Adults INTEGER, Kids INTEGER ) CREATE TABLE Rooms ( RoomId TEXT, roomName TEXT, beds INTEGER, bedType TEXT, maxOccupancy INTEGER, baseP...
Return the room and number of reservations made for each of the rooms to draw a bar chart, display X-axis in desc order.
SELECT Room, COUNT(*) FROM Reservations AS T1 JOIN Rooms AS T2 ON T1.Room = T2.RoomId GROUP BY T1.Room ORDER BY Room DESC
CREATE TABLE table_2436 ( "Conference" text, "Regular Season Winner" text, "Conference Player of the Year" text, "Conference Tournament" text, "Tournament Venue (City)" text, "Tournament Winner" text )
Where was the tourney when UCLA won the regular season?
SELECT "Tournament Venue (City)" FROM table_2436 WHERE "Regular Season Winner" = 'UCLA'
CREATE TABLE table_name_25 ( record VARCHAR, date VARCHAR )
What was the record on june 29?
SELECT record FROM table_name_25 WHERE date = "june 29"
CREATE TABLE table_65469 ( "Heat" real, "Lane" real, "Name" text, "Nationality" text, "Time" text )
What is the total heat number of sun yang, who has a lane less than 2?
SELECT COUNT("Heat") FROM table_65469 WHERE "Name" = 'sun yang' AND "Lane" < '2'
CREATE TABLE table_22915134_2 ( ignition_timing VARCHAR, graphical VARCHAR )
When 1-1-0-0-1-1-0-0- is the graphical how many ignition timings are there?
SELECT COUNT(ignition_timing) FROM table_22915134_2 WHERE graphical = "1-1-0-0-1-1-0-0-"
CREATE TABLE Finances ( Finance_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Channels ( Channel_ID INTEGER, Other_Details VARCHAR(255) ) CREATE TABLE Assets_in_Events ( Asset_ID INTEGER, Event_ID INTEGER ) CREATE TABLE Parties_in_Events ( Party_ID INTEGER, Event_ID INTEGER, ...
Show the names of products and the number of events they are in by a bar chart, display from high to low by the x axis.
SELECT Product_Name, COUNT(*) FROM Products AS T1 JOIN Products_in_Events AS T2 ON T1.Product_ID = T2.Product_ID GROUP BY T1.Product_Name ORDER BY Product_Name DESC
CREATE TABLE table_23821 ( "Barangay" text, "District" text, "Population (May 1, 2000)" real, "Population (August 1, 2007)" real, "Population (May 1, 2010)" text )
Name th epopulation may for general terrero
SELECT "Population (May 1, 2000)" FROM table_23821 WHERE "Barangay" = 'General Terrero'
CREATE TABLE table_name_2 ( opponent VARCHAR, game VARCHAR, december VARCHAR )
Who was the opponent on December 1, before Game 28?
SELECT opponent FROM table_name_2 WHERE game < 28 AND december = 1
CREATE TABLE Person ( name varchar(20), age INTEGER, city TEXT, gender TEXT, job TEXT ) CREATE TABLE PersonFriend ( name varchar(20), friend varchar(20), year INTEGER )
Draw a pie chart for what is the average age for a male in each job?
SELECT job, AVG(age) FROM Person WHERE gender = 'male' GROUP BY job
CREATE TABLE table_26708105_5 ( aa_length VARCHAR, protein_name VARCHAR )
What is the aa length when the protein name is c11orf73?
SELECT aa_length FROM table_26708105_5 WHERE protein_name = "C11orf73"
CREATE TABLE table_name_82 ( finish VARCHAR, manager VARCHAR, record VARCHAR )
what is the finish when the manager is tom kotchman and record is 43-33?
SELECT finish FROM table_name_82 WHERE manager = "tom kotchman" AND record = "43-33"
CREATE TABLE Lives_in ( stuid INTEGER, dormid INTEGER, room_number 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 Dorm_amenity ( ameni...
Find the average age of male students (with sex M) from each city, show X-axis in ascending order.
SELECT city_code, AVG(Age) FROM Student WHERE Sex = 'M' GROUP BY city_code ORDER BY city_code
CREATE TABLE table_20088 ( "Locale" text, "Skip" text, "W" real, "L" real, "PF" real, "PA" real, "Ends Won" real, "Ends Lost" real, "Blank Ends" real, "Stolen Ends" real, "Shot Pct." text )
What was the top ends lost where the ends won 47?
SELECT MAX("Ends Lost") FROM table_20088 WHERE "Ends Won" = '47'
CREATE TABLE voting_record ( stuid number, registration_date text, election_cycle text, president_vote number, vice_president_vote number, secretary_vote number, treasurer_vote number, class_president_vote number, class_senator_vote number ) CREATE TABLE student ( stuid number, ...
What are the distinct last names of the students who have president votes and have 8741 as the advisor?
SELECT DISTINCT T1.lname FROM student AS T1 JOIN voting_record AS T2 ON T1.stuid = president_vote INTERSECT SELECT DISTINCT lname FROM student WHERE advisor = "8741"
CREATE TABLE View_Unit_Status ( apt_id INTEGER, apt_booking_id INTEGER, status_date DATETIME, available_yn BIT ) CREATE TABLE Apartment_Buildings ( building_id INTEGER, building_short_name CHAR(15), building_full_name VARCHAR(80), building_description VARCHAR(255), building_address ...
What is the number of start date of each apartment booking for each year? Return a bar chart, could you display total number in asc order?
SELECT booking_start_date, COUNT(booking_start_date) FROM Apartment_Bookings AS T1 JOIN Apartments AS T2 ON T1.apt_id = T2.apt_id ORDER BY COUNT(booking_start_date)
CREATE TABLE CloseAsOffTopicReasonTypes ( Id number, IsUniversal boolean, InputTitle text, MarkdownInputGuidance text, MarkdownPostOwnerGuidance text, MarkdownPrivilegedUserGuidance text, MarkdownConcensusDescription text, CreationDate time, CreationModeratorId number, ApprovalDa...
Whose posts do I comment on?.
SELECT UserId AS "user_link", CommentCount, up.postCount, ROUND(CAST(CommentCount AS FLOAT) / up.postCount, 2) AS ratio FROM (SELECT COUNT(c.Id) AS commentCount, p.OwnerUserId AS userid FROM (SELECT Id, PostId FROM Comments WHERE UserId = '##userid##') AS c JOIN Posts AS p ON c.PostId = p.Id GROUP BY p.OwnerUserId) AS ...
CREATE TABLE table_15887683_10 ( content VARCHAR, television_service VARCHAR, dar VARCHAR, package_option VARCHAR, language VARCHAR )
Name the content for sky famiglia for italian and dar 16:9 for mtv hits
SELECT content FROM table_15887683_10 WHERE package_option = "Sky Famiglia" AND language = "Italian" AND dar = "16:9" AND television_service = "MTV Hits"
CREATE TABLE table_name_24 ( laps INTEGER, driver VARCHAR )
What is the high lap total for pedro diniz?
SELECT MAX(laps) FROM table_name_24 WHERE driver = "pedro diniz"
CREATE TABLE table_14323347_1 ( points VARCHAR )
Name the total number of 1992-93 for 115 points
SELECT COUNT(1992 AS _93) FROM table_14323347_1 WHERE points = 115
CREATE TABLE party ( Party_ID int, Year real, Party text, Governor text, Lieutenant_Governor text, Comptroller text, Attorney_General text, US_Senate text ) CREATE TABLE election ( Election_ID int, Counties_Represented text, District int, Delegate text, Party int, ...
Show the county name and population of all counties Show bar chart, list Y-axis from high to low order.
SELECT County_name, Population FROM county ORDER BY Population DESC
CREATE TABLE table_name_16 ( away_team VARCHAR, venue VARCHAR )
Who was the away team at the game held at Arden Street Oval?
SELECT away_team FROM table_name_16 WHERE venue = "arden street oval"
CREATE TABLE PostNoticeTypes ( Id number, ClassId number, Name text, Body text, IsHidden boolean, Predefined boolean, PostNoticeDurationId number ) CREATE TABLE Posts ( Id number, PostTypeId number, AcceptedAnswerId number, ParentId number, CreationDate time, Deletio...
Number of badges awarded by badge name.
SELECT Name, COUNT(*) AS "number of badges" FROM Badges GROUP BY Name
CREATE TABLE table_16186152_1 ( percentage VARCHAR, state_delegate VARCHAR )
What's the percentage when the state delegate is 1662?
SELECT percentage FROM table_16186152_1 WHERE state_delegate = 1662
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, ...
give the number of patients who are aged below 45 years whose admission location is phys referral/normal deli.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_location = "PHYS REFERRAL/NORMAL DELI" AND demographic.age < "45"
CREATE TABLE table_17827271_1 ( roleplay VARCHAR, actor_required VARCHAR )
How many RolePlay actors played the role requiring a 'male, younger' actor?
SELECT COUNT(roleplay) FROM table_17827271_1 WHERE actor_required = "Male, younger"
CREATE TABLE table_25358 ( "Order" real, "Episode" text, "Airdate" text, "Rating" text, "Share" real, "Rating/Share (18\u201349)" text, "Viewers (millions)" text, "Rank (night)" real )
Name the most share for 2.76 million viewers
SELECT MAX("Share") FROM table_25358 WHERE "Viewers (millions)" = '2.76'
CREATE TABLE table_1639689_2 ( kickoff VARCHAR, date VARCHAR )
What was the kickoff time on monday, may 13?
SELECT kickoff FROM table_1639689_2 WHERE date = "Monday, May 13"
CREATE TABLE table_67666 ( "Team" text, "Games Played" real, "Wins" real, "Losses" real, "Ties" real, "Goals For" real, "Goals Against" real )
What team has the most wins with at least 18 goals and less than 5 losses?
SELECT MAX("Wins") FROM table_67666 WHERE "Goals For" = '18' AND "Losses" < '5'
CREATE TABLE table_30200 ( "No." real, "Title" text, "Lyricist" text, "Composer" text, "Arrangement" text, "Sound Engineer" text, "Length" text )
What is the arrangement for bets3ab 3alia nafsy?
SELECT "Arrangement" FROM table_30200 WHERE "Title" = 'Bets3ab 3alia Nafsy'
CREATE TABLE table_203_790 ( id number, "week" number, "date" text, "opponent" text, "result" text, "attendance" number )
what is the total number of wins ?
SELECT COUNT(*) FROM table_203_790 WHERE "result" = 'w'
CREATE TABLE table_24116 ( "Game" real, "Date" text, "Opponent" text, "Result" text, "Black Knights points" real, "Opponents" real, "Record" text )
How many games have Air Force as the opponent?
SELECT MAX("Game") FROM table_24116 WHERE "Opponent" = 'Air Force'
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 patients whose marital status is married and procedure long title is closure of skin and subcutaneous tissue of other sites?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.marital_status = "MARRIED" AND procedures.long_title = "Closure of skin and subcutaneous tissue of other sites"
CREATE TABLE table_204_713 ( id number, "rank" number, "bib" number, "athlete" text, "country" text, "time" text, "deficit" text )
the first time on the list is ?
SELECT "time" FROM table_204_713 WHERE id = 1
CREATE TABLE table_24192190_1 ( magnitude VARCHAR, latitude VARCHAR )
When 43.048 n is the latitude what is the magnitude?
SELECT magnitude FROM table_24192190_1 WHERE latitude = "43.048° N"
CREATE TABLE time_interval ( period text, begin_time int, end_time int ) CREATE TABLE compartment_class ( compartment varchar, class_type varchar ) CREATE TABLE state ( state_code text, state_name text, country_name text ) CREATE TABLE flight ( aircraft_code_sequence text, air...
i'd like to leave ATLANTA in the afternoon and arrive in PHILADELPHIA at 1700
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, flight WHERE ((CITY_1.city_code = AIRPORT_SERVICE_1.city_code AND CITY_1.city_name = 'PHILADELPHIA' AND flight.arrival_time = 1700 AND flight.to_airport = AIRPORT_SERVICE_1.a...
CREATE TABLE tracklists ( albumid number, position number, songid number ) CREATE TABLE instruments ( songid number, bandmateid number, instrument text ) CREATE TABLE songs ( songid number, title text ) CREATE TABLE band ( id number, firstname text, lastname text ) CREATE...
What is the first and last name of the artist who performed back stage for the song 'Der Kapitan'?
SELECT T2.firstname, T2.lastname FROM performance AS T1 JOIN band AS T2 ON T1.bandmate = T2.id JOIN songs AS T3 ON T3.songid = T1.songid WHERE T3.title = "Der Kapitan" AND T1.stageposition = "back"
CREATE TABLE table_name_74 ( points_won VARCHAR, year VARCHAR, total_matches VARCHAR )
In 2007, how many points were won when more than 5 matches were played?
SELECT COUNT(points_won) FROM table_name_74 WHERE year = "2007" AND total_matches > 5
CREATE TABLE table_name_24 ( split__50m_ INTEGER, name VARCHAR, lane VARCHAR )
What is the total sum of 50m splits for josefin lillhage in lanes above 8?
SELECT SUM(split__50m_) FROM table_name_24 WHERE name = "josefin lillhage" AND lane > 8
CREATE TABLE cost ( row_id number, subject_id number, hadm_id number, event_type text, event_id number, chargetime time, cost number ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, war...
is on 12/16/this year patient 739's arterial bp [systolic] normal?
SELECT COUNT(*) > 0 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 = 739)) AND chartevents.itemid IN (SELECT d_items.itemid FROM d_items WHERE d_items.label = 'arterial bp [systol...
CREATE TABLE table_201_15 ( id number, "year" number, "single" text, "chart positions\nspa" number, "album" text )
based on sales figures , what auryn album is the most popular ?
SELECT "album" FROM table_201_15 ORDER BY "chart positions\nspa" LIMIT 1
CREATE TABLE table_11404452_1 ( director VARCHAR, us_viewers__millions_ VARCHAR )
Who was the director when there were 13.66 million u.s viewers?
SELECT director FROM table_11404452_1 WHERE us_viewers__millions_ = "13.66"
CREATE TABLE table_28138035_4 ( womens_doubles VARCHAR, mens_singles VARCHAR )
Name the womens doubles for werner schlager
SELECT womens_doubles FROM table_28138035_4 WHERE mens_singles = "Werner Schlager"
CREATE TABLE ReviewTaskStates ( Id number, Name text, Description text ) CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownV...
Reputation per answers, for users with at least x posts and y reputation.
SELECT Rank = ROW_NUMBER() OVER (ORDER BY ROUND((CAST('Total Score' AS FLOAT) / CAST('Total Answers' AS FLOAT)), 2) DESC), ROUND((CAST('Total Score' AS FLOAT) / CAST('Total Answers' AS FLOAT)), 2) AS "Score Per Answer", u.Id AS "user_link", u.Reputation, 'Total Answers', ROUND((CAST(u.Reputation AS FLOAT) / CAST('Total...
CREATE TABLE table_4881 ( "Home team" text, "Home team score" text, "Away team" text, "Away team score" text, "Venue" text, "Crowd" real, "Date" text )
What is the away team's score at brunswick street oval?
SELECT "Away team score" FROM table_4881 WHERE "Venue" = 'brunswick street oval'
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 death status is 1 and diagnoses icd9 code is 2864.
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.expire_flag = "1" AND diagnoses.icd9_code = "2864"
CREATE TABLE table_name_66 ( constructor VARCHAR, time_retired VARCHAR )
Who built the car that has a Time/Retired of 1:36:38.887?
SELECT constructor FROM table_name_66 WHERE time_retired = "1:36:38.887"
CREATE TABLE table_name_95 ( event VARCHAR, class VARCHAR )
What is the event when the class is time trial hc a?
SELECT event FROM table_name_95 WHERE class = "time trial hc a"
CREATE TABLE table_6604 ( "Player" text, "Rating" real, "Cmp." real, "Att." real, "Cmp. %" real, "Yards" real, "Int." real, "Long" real )
Which Cmp % has an Int smaller than 2 and a Cmpnsmaller than 1?
SELECT MIN("Cmp. %") FROM table_6604 WHERE "Int." < '2' AND "Cmp." < '1'
CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, charttime time ) CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, ...
when did patient 13528 receive his or her prescription for the last time since 12/2104?
SELECT prescriptions.startdate FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 13528) AND STRFTIME('%y-%m', prescriptions.startdate) >= '2104-12' ORDER BY prescriptions.startdate DESC LIMIT 1
CREATE TABLE transfers ( row_id number, subject_id number, hadm_id number, icustay_id number, eventtype text, careunit text, wardid number, intime time, outtime time ) CREATE TABLE procedures_icd ( row_id number, subject_id number, hadm_id number, icd9_code text, ...
count the current patients whose age is 20s.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.dischtime IS NULL AND admissions.age BETWEEN 20 AND 29
CREATE TABLE table_name_30 ( competition VARCHAR, year VARCHAR )
Which Competition has a Year of 1993?
SELECT competition FROM table_name_30 WHERE year = 1993
CREATE TABLE table_64868 ( "Year" real, "Game" text, "Genre" text, "Platform(s)" text, "Developer(s)" text )
Which platforms can you play Portal 2 on?
SELECT "Platform(s)" FROM table_64868 WHERE "Game" = 'portal 2'
CREATE TABLE table_203_171 ( id number, "place\n(posicion)" number, "team\n(equipo)" text, "played\n(pj)" number, "won\n(pg)" number, "draw\n(pe)" number, "lost\n(pp)" number, "goals scored\n(gf)" number, "goals conceded\n(gc)" number, "+/-\n(dif.)" number, "points\n(pts.)" n...
list each team with the most draws .
SELECT "team\n(equipo)" FROM table_203_171 WHERE "draw\n(pe)" = (SELECT MAX("draw\n(pe)") FROM table_203_171)
CREATE TABLE table_18123274_1 ( year__ceremony_ VARCHAR, result VARCHAR, director VARCHAR )
Name the year for not nominated for alberto aruelo
SELECT year__ceremony_ FROM table_18123274_1 WHERE result = "Not Nominated" AND director = "Alberto Aruelo"
CREATE TABLE table_name_86 ( result VARCHAR, opponent VARCHAR )
What is the result against Clemson?
SELECT result FROM table_name_86 WHERE opponent = "clemson"
CREATE TABLE table_26224 ( "Year" real, "Division" real, "League" text, "Regular Season" text, "Playoffs" text, "Open Cup" text )
Name the total number of open cup for 1996
SELECT COUNT("Open Cup") FROM table_26224 WHERE "Year" = '1996'
CREATE TABLE table_name_75 ( constructor VARCHAR, date VARCHAR )
Name the constructor for 10 august
SELECT constructor FROM table_name_75 WHERE date = "10 august"
CREATE TABLE Users ( Id number, Reputation number, CreationDate time, DisplayName text, LastAccessDate time, WebsiteUrl text, Location text, AboutMe text, Views number, UpVotes number, DownVotes number, ProfileImageUrl text, EmailHash text, AccountId number ) CRE...
Number of users created / day.
SELECT DATE(CreationDate), COUNT(*) AS Actual, MAX(Id) - MIN(Id) AS Expected, MIN(Id), MAX(Id) FROM Users GROUP BY DATE(CreationDate) ORDER BY 1 DESC
CREATE TABLE treatment ( treatmentid number, patientunitstayid number, treatmentname text, treatmenttime time ) CREATE TABLE cost ( costid number, uniquepid text, patienthealthsystemstayid number, eventtype text, eventid number, chargetime time, cost number ) CREATE TABLE d...
what procedure did patient 017-74343 the previous year receive for the first time?
SELECT treatment.treatmentname FROM treatment WHERE treatment.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '017-74343')) AND DATETIME(treatment.treatmenttime, 'start of year...
CREATE TABLE Ref_Budget_Codes ( Budget_Type_Code CHAR(15), Budget_Type_Description VARCHAR(255) ) CREATE TABLE Projects ( Project_ID INTEGER, Project_Details VARCHAR(255) ) CREATE TABLE Documents_with_Expenses ( Document_ID INTEGER, Budget_Type_Code CHAR(15), Document_Details VARCHAR(255) ...
How many document type for different document type description? Visualize with a bar chart, order in asc by the Y-axis.
SELECT Document_Type_Description, COUNT(Document_Type_Description) FROM Ref_Document_Types GROUP BY Document_Type_Description ORDER BY COUNT(Document_Type_Description)
CREATE TABLE table_62198 ( "Player" text, "Height" real, "Position" text, "Year born (Age)" text, "Current Club" text )
What is the current club with a position of sg/sf and a height less than 1.96?
SELECT "Current Club" FROM table_62198 WHERE "Position" = 'sg/sf' AND "Height" < '1.96'
CREATE TABLE table_13622 ( "School" text, "Location" text, "Mascot" text, "Enrollment" real, "IHSAA Class" text, "# / County" text )
What is the IHSAA class for the school where the mascot is the Rebels?
SELECT "IHSAA Class" FROM table_13622 WHERE "Mascot" = 'rebels'
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,...
count the number of patients whose ethnicity is black/cape verdean and drug code is hydr20/100ns?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.ethnicity = "BLACK/CAPE VERDEAN" AND prescriptions.formulary_drug_cd = "HYDR20/100NS"
CREATE TABLE news_report ( journalist_id number, event_id number, work_type text ) CREATE TABLE event ( event_id number, date text, venue text, name text, event_attendance number ) CREATE TABLE journalist ( journalist_id number, name text, nationality text, age text, ...
Show the names of journalists that have reported more than one event.
SELECT T3.name FROM news_report AS T1 JOIN event AS T2 ON T1.event_id = T2.event_id JOIN journalist AS T3 ON T1.journalist_id = T3.journalist_id GROUP BY T3.name HAVING COUNT(*) > 1
CREATE TABLE table_27409644_1 ( location VARCHAR, ground VARCHAR )
Where is lootospark from?
SELECT location FROM table_27409644_1 WHERE ground = "Lootospark"
CREATE TABLE Problem_Log ( problem_log_id INTEGER, assigned_to_staff_id INTEGER, problem_id INTEGER, problem_category_code VARCHAR(20), problem_status_code VARCHAR(20), log_entry_date DATETIME, log_entry_description VARCHAR(255), log_entry_fix VARCHAR(255), other_log_details VARCHAR(...
Draw a bar chart for what is the number of entry descriptions of each problem?, and show in descending by the X-axis.
SELECT log_entry_description, COUNT(log_entry_description) FROM Problem_Log GROUP BY log_entry_description ORDER BY log_entry_description DESC
CREATE TABLE ReviewTasks ( Id number, ReviewTaskTypeId number, CreationDate time, DeletionDate time, ReviewTaskStateId number, PostId number, SuggestedEditId number, CompletedByReviewTaskId number ) CREATE TABLE Votes ( Id number, PostId number, VoteTypeId number, UserId...
Top 50 users from Surat.
SELECT ROW_NUMBER() OVER (ORDER BY Reputation DESC) AS "#", Id AS "user_link", Reputation FROM Users WHERE LOWER(Location) LIKE '%rajkot%' OR UPPER(Location) LIKE '%RAJKOT' ORDER BY Reputation DESC LIMIT 50