schema
stringlengths
27
5.9k
question
stringlengths
3
990
rejected
stringlengths
2
4.44k
chosen
stringlengths
4
9.17k
weight
float64
0
8.95
CREATE TABLE table_name_5 (dvd_title STRING, aspect_ratio STRING, release_date STRING)
What title was release November 17, 2009 in a 16:9 aspect ratio?
SELECT dvd_title FROM table_name_5 WHERE aspect_ratio = "16:9" AND release_date = "november 17, 2009"
SELECT `dvd_title` FROM `table_name_5` WHERE `16:9` = `aspect_ratio` AND `november 17, 2009` = `release_date`
0.106445
CREATE TABLE table_204_301 (id NUMERIC, `nationality` STRING, `name` STRING, `term as a deputy judge` STRING, `reason for termination` STRING)
who was the last deputy judge with finland nationality ?
SELECT "name" FROM table_204_301 WHERE "nationality" = 'finland' ORDER BY "term as a deputy judge" DESC LIMIT 1
SELECT `name` FROM `table_204_301` WHERE `nationality` = 'finland' ORDER BY `term as a deputy judge` DESC LIMIT 1
0.110352
CREATE TABLE table_name_38 (torque STRING, power STRING)
Power of 220kw (299hp) @ 4000 has what torque?
SELECT torque FROM table_name_38 WHERE power = "220kw (299hp) @ 4000"
SELECT `torque` FROM `table_name_38` WHERE `220kw (299hp) @ 4000` = `power`
0.073242
CREATE TABLE table_34654 (`Number of Decks` FLOAT64, `Non-Suited Match` STRING, `Double Non-Suited Match` STRING, `Suited Match` STRING, `Suited + Non-Suited Match` STRING, `Double Suited Match` STRING, `House Edge` STRING)
With a house edge of 3.53% and a Non-Suited Matched of 3:1, name the Double Non-Suited Match.
SELECT "Double Non-Suited Match" FROM table_34654 WHERE "Non-Suited Match" = '3:1' AND "House Edge" = '3.53%'
SELECT `Double Non-Suited Match` FROM `table_34654` WHERE `House Edge` = '3.53%' AND `Non-Suited Match` = '3:1'
0.108398
CREATE TABLE table_13359 (`Constituency number` STRING, `Name` STRING, `Reserved for ( SC / ST /None ) ` STRING, `District` STRING, `Number of electorates ( 2009 ) ` FLOAT64)
What is the average number of electorates (2009) when the district is indore?
SELECT AVG("Number of electorates (2009)") FROM table_13359 WHERE "District" = 'indore'
SELECT AVG(`Number of electorates (2009)`) FROM `table_13359` WHERE `District` = 'indore'
0.086914
CREATE TABLE table_24696 (`No.` FLOAT64, `#` FLOAT64, `Title` STRING, `Directed by` STRING, `Written by` STRING, `Original air date` STRING, `Production code` STRING, `U.S. viewers ( million ) ` STRING)
who are the writers of the episode that had 3.07 millions of North American spectators?
SELECT "Written by" FROM table_24696 WHERE "U.S. viewers (million)" = '3.07'
SELECT `Written by` FROM `table_24696` WHERE `U.S. viewers (million)` = '3.07'
0.076172
CREATE TABLE table_name_62 (date STRING, runner_s__up STRING)
On what Date was Patty Sheehan Runner(s)-up?
SELECT date FROM table_name_62 WHERE runner_s__up = "patty sheehan"
SELECT `date` FROM `table_name_62` WHERE `patty sheehan` = `runner_s__up`
0.071289
CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME)
what are the five most frequently given diagnoses for patients who had previously had antibacterials - cephalosporin within the same hospital visit, since 2101?
SELECT t3.diagnosisname FROM (SELECT t2.diagnosisname, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM (SELECT patient.uniquepid, treatment.treatmenttime, patient.patienthealthsystemstayid FROM treatment JOIN patient ON treatment.patientunitstayid = patient.patientunitstayid WHERE treatment.treatmentname = 'antibacterials - cephalosporin' AND STRFTIME('%y', treatment.treatmenttime) >= '2101') AS t1 JOIN (SELECT patient.uniquepid, diagnosis.diagnosisname, diagnosis.diagnosistime, patient.patienthealthsystemstayid FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE STRFTIME('%y', diagnosis.diagnosistime) >= '2101') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.treatmenttime < t2.diagnosistime AND t1.patienthealthsystemstayid = t2.patienthealthsystemstayid GROUP BY t2.diagnosisname) AS t3 WHERE t3.c1 <= 5
WITH `t2` AS (SELECT `patient`.`uniquepid`, `diagnosis`.`diagnosisname`, `diagnosis`.`diagnosistime`, `patient`.`patienthealthsystemstayid` FROM `diagnosis` JOIN `patient` ON `diagnosis`.`patientunitstayid` = `patient`.`patientunitstayid` WHERE STRFTIME('%y', `diagnosis`.`diagnosistime`) >= '2101'), `t3` AS (SELECT `t2`.`diagnosisname`, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS `c1` FROM `treatment` JOIN `patient` ON `patient`.`patientunitstayid` = `treatment`.`patientunitstayid` JOIN `t2` AS `t2` ON `patient`.`patienthealthsystemstayid` = `t2`.`patienthealthsystemstayid` AND `patient`.`uniquepid` = `t2`.`uniquepid` AND `t2`.`diagnosistime` > `treatment`.`treatmenttime` WHERE `treatment`.`treatmentname` = 'antibacterials - cephalosporin' AND STRFTIME('%y', `treatment`.`treatmenttime`) >= '2101' GROUP BY `t2`.`diagnosisname`) SELECT `t3`.`diagnosisname` FROM `t3` AS `t3` WHERE `t3`.`c1` <= 5
0.885742
CREATE TABLE table_name_79 (score STRING, place STRING, player STRING)
How much did Jerry Barber score to come in at T9?
SELECT score FROM table_name_79 WHERE place = "t9" AND player = "jerry barber"
SELECT `score` FROM `table_name_79` WHERE `jerry barber` = `player` AND `place` = `t9`
0.083984
CREATE TABLE table_71990 (`Rank` FLOAT64, `Mountain Peak` STRING, `Province` STRING, `Mountain Range` STRING, `Location` STRING)
Which location includes Coast Mountains with a rank less than 18 at Skihist Mountain?
SELECT "Location" FROM table_71990 WHERE "Mountain Range" = 'coast mountains' AND "Rank" < '18' AND "Mountain Peak" = 'skihist mountain'
SELECT `Location` FROM `table_71990` WHERE `Mountain Peak` = 'skihist mountain' AND `Mountain Range` = 'coast mountains' AND `Rank` < '18'
0.134766
CREATE TABLE postseason (YEAR STRING, ties STRING)
How many games in 1885 postseason resulted in ties (that is, the value of 'ties' is '1')?
SELECT COUNT(*) FROM postseason WHERE YEAR = 1885 AND ties = 1
SELECT COUNT(*) FROM `postseason` WHERE `YEAR` = 1885 AND `ties` = 1
0.066406
CREATE TABLE table_30112 (`Player` STRING, `Matches` FLOAT64, `Innings` FLOAT64, `Wickets` FLOAT64, `Average` STRING, `BBI` STRING, `BBM` STRING, `5wi` FLOAT64)
What is the least amount of wickets?
SELECT MIN("Wickets") FROM table_30112
SELECT MIN(`Wickets`) FROM `table_30112`
0.039063
CREATE TABLE table_name_3 (score STRING, competition STRING)
What was the Score of the 2008 Africa Cup of Nations Competition?
SELECT score FROM table_name_3 WHERE competition = "2008 africa cup of nations"
SELECT `score` FROM `table_name_3` WHERE `2008 africa cup of nations` = `competition`
0.083008
CREATE TABLE table_name_33 (prr_class STRING, wheel_arrangement STRING)
What PRR class has a Wheel arrangement of a1a-a1a?
SELECT prr_class FROM table_name_33 WHERE wheel_arrangement = "a1a-a1a"
SELECT `prr_class` FROM `table_name_33` WHERE `a1a-a1a` = `wheel_arrangement`
0.075195
CREATE TABLE table_name_43 (stadium STRING, result STRING)
What stadium was the game played at when the result was hunter mariners def. sheffield eagles?
SELECT stadium FROM table_name_43 WHERE result = "hunter mariners def. sheffield eagles"
SELECT `stadium` FROM `table_name_43` WHERE `hunter mariners def. sheffield eagles` = `result`
0.091797
CREATE TABLE storm (Storm_ID INT64, Name STRING, Dates_active STRING, Max_speed INT64, Damage_millions_USD FLOAT64, Number_Deaths INT64) CREATE TABLE region (Region_id INT64, Region_code STRING, Region_name STRING) CREATE TABLE affected_region (Region_id INT64, Storm_ID INT64, Number_city_affected FLOAT64)
Show me a bar chart for how many storms occured in each region?, and order total number from high to low order.
SELECT Region_name, COUNT(*) FROM region AS T1 JOIN affected_region AS T2 ON T1.Region_id = T2.Region_id GROUP BY T1.Region_id ORDER BY COUNT(*) DESC
SELECT `Region_name`, COUNT(*) FROM `region` AS `T1` JOIN `affected_region` AS `T2` ON `T1`.`region_id` = `T2`.`region_id` GROUP BY `T1`.`region_id` ORDER BY COUNT(*) DESC
0.166992
CREATE TABLE table_name_72 (nationality STRING, position STRING)
What is the nationality of the center?
SELECT nationality FROM table_name_72 WHERE position = "center"
SELECT `nationality` FROM `table_name_72` WHERE `center` = `position`
0.067383
CREATE TABLE table_14623167_1 (call_sign STRING, physical STRING)
Name the call sign for the 17 physical
SELECT call_sign FROM table_14623167_1 WHERE physical = 17
SELECT `call_sign` FROM `table_14623167_1` WHERE `physical` = 17
0.0625
CREATE TABLE table_34849 (`Tournament` STRING, `1981` STRING, `1982` STRING, `1983` STRING, `1984` STRING, `1985` STRING, `1986` STRING, `1987` STRING, `1988` STRING, `1989` STRING)
Which Tournament has a 1984 of 1r?
SELECT "Tournament" FROM table_34849 WHERE "1984" = '1r'
SELECT `Tournament` FROM `table_34849` WHERE `1984` = '1r'
0.056641
CREATE TABLE table_name_93 (place STRING, date STRING)
Which place was earned on 12 feb 2012?
SELECT place FROM table_name_93 WHERE date = "12 feb 2012"
SELECT `place` FROM `table_name_93` WHERE `12 feb 2012` = `date`
0.0625
CREATE TABLE sampledata15 (sample_pk NUMERIC, state STRING, year STRING, month STRING, day STRING, site STRING, commod STRING, source_id STRING, variety STRING, origin STRING, country STRING, disttype STRING, commtype STRING, claim STRING, quantity NUMERIC, growst STRING, packst STRING, distst STRING) CREATE TABLE resultsdata15 (sample_pk NUMERIC, commod STRING, commtype STRING, lab STRING, pestcode STRING, testclass STRING, concen NUMERIC, lod NUMERIC, conunit STRING, confmethod STRING, confmethod2 STRING, annotate STRING, quantitate STRING, mean STRING, `extract` STRING, determin STRING)
What's the code for test for sample 7498?
SELECT testclass FROM resultsdata15 WHERE sample_pk = 7498
SELECT `testclass` FROM `resultsdata15` WHERE `sample_pk` = 7498
0.0625
CREATE TABLE table_name_53 (wins INT64, percent STRING, teams STRING)
what is the average wins when percent is more than 0.4 and teams is chargers~?
SELECT AVG(wins) FROM table_name_53 WHERE percent > 0.4 AND teams = "chargers~"
SELECT AVG(`wins`) FROM `table_name_53` WHERE `chargers~` = `teams` AND `percent` > 0.4
0.084961
CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING)
what's the minimum cost of a hospital that includes a cortisol lab test until 4 years ago?
SELECT MIN(t1.c1) FROM (SELECT SUM(cost.cost) AS c1 FROM cost WHERE cost.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.patientunitstayid IN (SELECT lab.patientunitstayid FROM lab WHERE lab.labname = 'cortisol')) AND DATETIME(cost.chargetime) <= DATETIME(CURRENT_TIME(), '-4 year') GROUP BY cost.patienthealthsystemstayid) AS t1
WITH `_u_0` AS (SELECT `lab`.`patientunitstayid` FROM `lab` WHERE `lab`.`labname` = 'cortisol' GROUP BY `patientunitstayid`), `_u_1` AS (SELECT `patient`.`patienthealthsystemstayid` FROM `patient` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `patient`.`patientunitstayid` WHERE NOT `_u_0`.`` IS NULL GROUP BY `patienthealthsystemstayid`), `t1` AS (SELECT SUM(`cost`.`cost`) AS `c1` FROM `cost` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `cost`.`patienthealthsystemstayid` WHERE DATETIME(`cost`.`chargetime`) <= DATETIME(CURRENT_TIME(), '-4 year') AND NOT `_u_1`.`` IS NULL GROUP BY `cost`.`patienthealthsystemstayid`) SELECT MIN(`t1`.`c1`) FROM `t1` AS `t1`
0.637695
CREATE TABLE table_name_9 (catalog STRING, date STRING)
What is the Catalog with a Date that is march 13, 2002?
SELECT catalog FROM table_name_9 WHERE date = "march 13, 2002"
SELECT `catalog` FROM `table_name_9` WHERE `date` = `march 13, 2002`
0.066406
CREATE TABLE table_name_50 (fsb___ht__mhz_ STRING, southbridge STRING)
What is the FSB / HT (MHz) when the Southbridge is amd-8131 amd-8132?
SELECT fsb___ht__mhz_ FROM table_name_50 WHERE southbridge = "amd-8131 amd-8132"
SELECT `fsb___ht__mhz_` FROM `table_name_50` WHERE `amd-8131 amd-8132` = `southbridge`
0.083984
CREATE TABLE table_name_24 (distance STRING, race STRING)
What is the distance of the Sam's town 250 race?
SELECT distance FROM table_name_24 WHERE race = "sam's town 250"
SELECT `distance` FROM `table_name_24` WHERE `race` = `sam's town 250`
0.068359
CREATE TABLE aircraft (aid NUMERIC, name STRING, distance NUMERIC) CREATE TABLE certificate (eid NUMERIC, aid NUMERIC) CREATE TABLE flight (flno NUMERIC, origin STRING, destination STRING, distance NUMERIC, departure_date DATE, arrival_date DATE, price NUMERIC, aid NUMERIC) CREATE TABLE employee (eid NUMERIC, name STRING, salary NUMERIC)
Can you give a histogram to compare the number of flights to each destination city?, show in asc by the x-axis.
SELECT destination, COUNT(destination) FROM flight GROUP BY destination ORDER BY destination
SELECT `destination`, COUNT(`destination`) FROM `flight` GROUP BY `destination` ORDER BY `destination`
0.099609
CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress STRING) CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC) CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName STRING, LastAccessDate TIME, WebsiteUrl STRING, Location STRING, AboutMe STRING, Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl STRING, EmailHash STRING, AccountId NUMERIC) CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment STRING, Text STRING, Title STRING, Tags STRING, RevisionGUID other) CREATE TABLE VoteTypes (Id NUMERIC, Name STRING) CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body STRING, OwnerUserId NUMERIC, DeletionUserId NUMERIC) CREATE TABLE PostTypes (Id NUMERIC, Name STRING) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BOOL, InputTitle STRING, MarkdownInputGuidance STRING, MarkdownPostOwnerGuidance STRING, MarkdownPrivilegedUserGuidance STRING, MarkdownConcensusDescription STRING, CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC) CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text STRING, CreationDate TIME, UserDisplayName STRING, UserId NUMERIC, ContentLicense STRING) CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name STRING, Body STRING, IsHidden BOOL, Predefined BOOL, PostNoticeDurationId NUMERIC) CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC) CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName STRING, TargetTagName STRING, CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME) CREATE TABLE FlagTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC) CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BOOL, VoteTypeId NUMERIC, CreationDate TIME) CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name STRING, Date TIME, Class NUMERIC, TagBased BOOL) CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name STRING, Description STRING, PostTypeId NUMERIC) CREATE TABLE ReviewTaskStates (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment STRING) CREATE TABLE CloseReasonTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostHistoryTypes (Id NUMERIC, Name STRING) CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName STRING, Comment STRING, Text STRING, ContentLicense STRING) CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC) CREATE TABLE Tags (Id NUMERIC, TagName STRING, Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC) CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC)
Questions which attract controversial answers. Search for posts which have attracted significantly more controversial answers than good ones
SELECT p.Id AS "post_link", p.Score FROM (SELECT p.ParentId, COUNT(*) AS ContACnt FROM (SELECT PostId, up = SUM(CASE WHEN VoteTypeId = 2 THEN 1 ELSE 0 END), down = SUM(CASE WHEN VoteTypeId = 3 THEN 1 ELSE 0 END) FROM Votes AS v JOIN Posts AS p ON p.Id = v.PostId WHERE VoteTypeId IN (2, 3) AND PostTypeId = 2 GROUP BY PostId) AS ContA JOIN Posts AS p ON ContA.PostId = p.Id WHERE down > (up / '##UVDVRatio:int##') AND (down + up) > '##MinVotes:int##' AND p.Score > 0 GROUP BY p.ParentId) AS ContQ JOIN Posts AS p ON ContQ.ParentId = p.Id WHERE ContQ.ContACnt > (p.AnswerCount / 2) ORDER BY Score DESC
WITH `ContA` AS (SELECT `PostId` FROM `Votes` AS `v` JOIN `Posts` AS `p` ON `p`.`id` = `v`.`postid` WHERE `PostTypeId` = 2 AND `VoteTypeId` IN (2, 3) GROUP BY `PostId`), `ContQ` AS (SELECT `p`.`parentid`, COUNT(*) AS `ContACnt` FROM `ContA` AS `ContA` JOIN `Posts` AS `p` ON `ContA`.`PostId` = `p`.`id` AND `p`.`score` > 0 WHERE `down` > (`up` / NULLIF('##UVDVRatio:int##', 0)) AND (`down` + `up`) > '##MinVotes:int##' GROUP BY `p`.`parentid`) SELECT `p`.`id` AS `post_link`, `p`.`score` FROM `ContQ` AS `ContQ` JOIN `Posts` AS `p` ON `ContQ`.`ContACnt` > (`p`.`answercount` / NULLIF(2, 0)) AND `ContQ`.`ParentId` = `p`.`id` ORDER BY `Score` DESC
0.630859
CREATE TABLE table_train_247 (`id` INT64, `mini_mental_state_examination_mmse` INT64, `creatinine_consistently` FLOAT64, `creatinine_clearance_cl` FLOAT64, `seizure_disorder` BOOL, `age` FLOAT64, `NOUSE` FLOAT64)
seizure disorder
SELECT * FROM table_train_247 WHERE seizure_disorder = 1
SELECT * FROM `table_train_247` WHERE `seizure_disorder` = 1
0.058594
CREATE TABLE table_12679 (`Tries` FLOAT64, `Player` STRING, `Opponent` STRING, `Score` STRING, `Venue` STRING, `Round` STRING)
Who is the opponent of player phil graham?
SELECT "Opponent" FROM table_12679 WHERE "Player" = 'phil graham'
SELECT `Opponent` FROM `table_12679` WHERE `Player` = 'phil graham'
0.06543
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
what is the number of patients with newborn primary disease who had pleural lab test?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE demographic.diagnosis = "NEWBORN" AND lab.fluid = "Pleural"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `lab` ON `Pleural` = `lab`.`fluid` AND `demographic`.`hadm_id` = `lab`.`hadm_id` WHERE `NEWBORN` = `demographic`.`diagnosis`
0.193359
CREATE TABLE table_30036 (`Semitological abbreviation` STRING, `Hebrew name` STRING, `Arabic name` STRING, `Morphological category` STRING, `Hebrew Form` STRING, `Arabic form` STRING, `Approximate translation` STRING)
How many hebrew forms are there for the arabic form yuktibu ?
SELECT COUNT("Hebrew Form") FROM table_30036 WHERE "Arabic form" = 'yuktibu يكتب'
SELECT COUNT(`Hebrew Form`) FROM `table_30036` WHERE `Arabic form` = 'yuktibu يكتب'
0.081055
CREATE TABLE table_name_97 (home_team STRING)
What is melbourne's home team score?
SELECT home_team AS score FROM table_name_97 WHERE home_team = "melbourne"
SELECT `home_team` AS `score` FROM `table_name_97` WHERE `home_team` = `melbourne`
0.080078
CREATE TABLE table_name_78 (laps INT64, time_retired STRING)
What is the average number of laps associated with a Time/Retired of +1:14.801?
SELECT AVG(laps) FROM table_name_78 WHERE time_retired = "+1:14.801"
SELECT AVG(`laps`) FROM `table_name_78` WHERE `+1:14.801` = `time_retired`
0.072266
CREATE TABLE table_77075 (`Season` FLOAT64, `Team 1` STRING, `Score` STRING, `Team 2` STRING, `Venue` STRING)
What was the score for the game in which Al-Qadsia was Team 2?
SELECT "Score" FROM table_77075 WHERE "Team 2" = 'al-qadsia'
SELECT `Score` FROM `table_77075` WHERE `Team 2` = 'al-qadsia'
0.060547
CREATE TABLE ReviewTaskStates (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment STRING, Text STRING, Title STRING, Tags STRING, RevisionGUID other) CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BOOL, InputTitle STRING, MarkdownInputGuidance STRING, MarkdownPostOwnerGuidance STRING, MarkdownPrivilegedUserGuidance STRING, MarkdownConcensusDescription STRING, CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC) CREATE TABLE PostTypes (Id NUMERIC, Name STRING) CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC) CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName STRING, LastAccessDate TIME, WebsiteUrl STRING, Location STRING, AboutMe STRING, Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl STRING, EmailHash STRING, AccountId NUMERIC) CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment STRING) CREATE TABLE PostHistoryTypes (Id NUMERIC, Name STRING) CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress STRING) CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC) CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC) CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName STRING, Comment STRING, Text STRING, ContentLicense STRING) CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName STRING, TargetTagName STRING, CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME) CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC) CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BOOL, VoteTypeId NUMERIC, CreationDate TIME) CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name STRING, Body STRING, IsHidden BOOL, Predefined BOOL, PostNoticeDurationId NUMERIC) CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body STRING, OwnerUserId NUMERIC, DeletionUserId NUMERIC) CREATE TABLE FlagTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Tags (Id NUMERIC, TagName STRING, Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC) CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC) CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name STRING, Description STRING, PostTypeId NUMERIC) CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text STRING, CreationDate TIME, UserDisplayName STRING, UserId NUMERIC, ContentLicense STRING) CREATE TABLE CloseReasonTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name STRING, Date TIME, Class NUMERIC, TagBased BOOL) CREATE TABLE VoteTypes (Id NUMERIC, Name STRING)
Stack Overflow tag total views and questions.
SELECT TagName AS Tag, ROW_NUMBER() OVER (ORDER BY Rate DESC) AS TotalRank, Rate AS TotalQuestions, TotalViews, TotalComments, TotalAnswers FROM (SELECT COUNT(PostId) AS Rate, TagName, SUM(CAST(ViewCount AS BIGINT)) AS TotalViews, SUM(CAST(CommentCount AS BIGINT)) AS TotalComments, COUNT(AcceptedAnswerId) AS TotalAnswers FROM Tags, PostTags, Posts WHERE Tags.Id = PostTags.TagId AND Posts.Id = PostId AND Posts.CreationDate < DATEADD(mm, DATEDIFF(mm, 0, GETDATE()) - 57, 0) GROUP BY TagName) AS tq WHERE Rate > 50
WITH `tq` AS (SELECT MAX(1) AS `_` FROM `Tags` JOIN `Posts` ON `PostId` = `Posts`.`id` AND `Posts`.`creationdate` < DATEADD(`mm`, DATE_DIFF(CAST(`mm` AS DATETIME), CAST(0 AS DATETIME), GETDATE()) - 57, 0) JOIN `PostTags` ON `PostTags`.`tagid` = `Tags`.`id` GROUP BY `TagName`) SELECT `TagName` AS `Tag`, ROW_NUMBER() OVER (ORDER BY `Rate` DESC) AS `TotalRank`, `Rate` AS `TotalQuestions`, `TotalViews`, `TotalComments`, `TotalAnswers` FROM `tq` AS `tq` WHERE `Rate` > 50
0.458984
CREATE TABLE table_56052 (`Date` STRING, `Visitor` STRING, `Score` STRING, `Home` STRING, `Leading scorer` STRING, `Attendance` FLOAT64, `Record` STRING)
What was the record in the competition in which the home team was the Mavericks?
SELECT "Record" FROM table_56052 WHERE "Home" = 'mavericks'
SELECT `Record` FROM `table_56052` WHERE `Home` = 'mavericks'
0.05957
CREATE TABLE table_19131 (`Character Name` STRING, `Voice Actor ( Japanese ) ` STRING, `Voice Actor ( English 1997 / Saban ) ` STRING, `Voice Actor ( English 1998 / Pioneer ) ` STRING, `Voice Actor ( English 2006 / FUNimation ) ` STRING)
what's the character name with voice actor (englbeingh 1997 / saban) being ian james corlett
SELECT "Character Name" FROM table_19131 WHERE "Voice Actor (English 1997 / Saban)" = 'Ian James Corlett'
SELECT `Character Name` FROM `table_19131` WHERE `Voice Actor (English 1997 / Saban)` = 'Ian James Corlett'
0.104492
CREATE TABLE gsi (course_offering_id INT64, student_id INT64) CREATE TABLE requirement (requirement_id INT64, requirement STRING, college STRING) CREATE TABLE offering_instructor (offering_instructor_id INT64, offering_id INT64, instructor_id INT64) CREATE TABLE instructor (instructor_id INT64, name STRING, uniqname STRING) CREATE TABLE area (course_id INT64, area STRING) CREATE TABLE course_tags_count (course_id INT64, clear_grading INT64, pop_quiz INT64, group_projects INT64, inspirational INT64, long_lectures INT64, extra_credit INT64, few_tests INT64, good_feedback INT64, tough_tests INT64, heavy_papers INT64, cares_for_students INT64, heavy_assignments INT64, respected INT64, participation INT64, heavy_reading INT64, tough_grader INT64, hilarious INT64, would_take_again INT64, good_lecture INT64, no_skip INT64) CREATE TABLE student (student_id INT64, lastname STRING, firstname STRING, program_id INT64, declare_major STRING, total_credit INT64, total_gpa FLOAT64, entered_as STRING, admit_term INT64, predicted_graduation_semester INT64, degree STRING, minor STRING, internship STRING) CREATE TABLE course_offering (offering_id INT64, course_id INT64, semester INT64, section_number INT64, start_time TIME, end_time TIME, monday STRING, tuesday STRING, wednesday STRING, thursday STRING, friday STRING, saturday STRING, sunday STRING, has_final_project STRING, has_final_exam STRING, textbook STRING, class_address STRING, allow_audit STRING) CREATE TABLE course (course_id INT64, name STRING, department STRING, number STRING, credits STRING, advisory_requirement STRING, enforced_requirement STRING, description STRING, num_semesters INT64, num_enrolled INT64, has_discussion STRING, has_lab STRING, has_projects STRING, has_exams STRING, num_reviews INT64, clarity_score INT64, easiness_score INT64, helpfulness_score INT64) CREATE TABLE jobs (job_id INT64, job_title STRING, description STRING, requirement STRING, city STRING, state STRING, country STRING, zip INT64) CREATE TABLE program (program_id INT64, name STRING, college STRING, introduction STRING) CREATE TABLE student_record (student_id INT64, course_id INT64, semester INT64, grade STRING, how STRING, transfer_source STRING, earn_credit STRING, repeat_term STRING, test_id STRING) CREATE TABLE semester (semester_id INT64, semester STRING, year INT64) CREATE TABLE ta (campus_job_id INT64, student_id INT64, location STRING) CREATE TABLE course_prerequisite (pre_course_id INT64, course_id INT64) CREATE TABLE program_course (program_id INT64, course_id INT64, workload INT64, category STRING) CREATE TABLE program_requirement (program_id INT64, category STRING, min_credit INT64, additional_req STRING) CREATE TABLE comment_instructor (instructor_id INT64, student_id INT64, score INT64, comment_text STRING)
Do upper-level classes all have exams ?
SELECT COUNT(*) = 0 FROM course INNER JOIN program_course ON program_course.course_id = course.course_id WHERE course.has_exams = 'N' AND program_course.category LIKE '%ULCS%'
SELECT COUNT(*) = 0 FROM `course` JOIN `program_course` ON `course`.`course_id` = `program_course`.`course_id` AND `program_course`.`category` LIKE '%ULCS%' WHERE `course`.`has_exams` = 'N'
0.18457
CREATE TABLE table_name_26 (Id STRING)
Name the 2006 when the 2010 is 27
SELECT 2006 FROM table_name_26 WHERE 2010 = "27"
SELECT 2006 FROM `table_name_26` WHERE `27` = 2010
0.048828
CREATE TABLE candidate (Candidate_ID INT64, People_ID INT64, Poll_Source STRING, Date STRING, Support_rate FLOAT64, Consider_rate FLOAT64, Oppose_rate FLOAT64, Unsure_rate FLOAT64) CREATE TABLE people (People_ID INT64, Sex STRING, Name STRING, Date_of_Birth STRING, Height FLOAT64, Weight FLOAT64)
What is the relationship between support and consider rates of each candidate?
SELECT Support_rate, Consider_rate FROM candidate
SELECT `Support_rate`, `Consider_rate` FROM `candidate`
0.053711
CREATE TABLE table_name_45 (team_2 STRING, team_1 STRING)
Which is team 2 when team 1 is ECAC Chaumont (d2)?
SELECT team_2 FROM table_name_45 WHERE team_1 = "ecac chaumont (d2)"
SELECT `team_2` FROM `table_name_45` WHERE `ecac chaumont (d2)` = `team_1`
0.072266
CREATE TABLE Teachers (teacher_id INT64, address_id INT64, first_name STRING, middle_name STRING, last_name STRING, gender STRING, cell_mobile_number STRING, email_address STRING, other_details STRING) CREATE TABLE Assessment_Notes (notes_id INT64, student_id INT64, teacher_id INT64, date_of_notes DATETIME, text_of_notes STRING, other_details STRING) CREATE TABLE Student_Addresses (student_id INT64, address_id INT64, date_address_from DATETIME, date_address_to DATETIME, monthly_rental NUMERIC, other_details STRING) CREATE TABLE Students (student_id INT64, address_id INT64, first_name STRING, middle_name STRING, last_name STRING, cell_mobile_number STRING, email_address STRING, date_first_rental DATETIME, date_left_university DATETIME, other_student_details STRING) CREATE TABLE Behavior_Incident (incident_id INT64, incident_type_code STRING, student_id INT64, date_incident_start DATETIME, date_incident_end DATETIME, incident_summary STRING, recommendations STRING, other_details STRING) CREATE TABLE Students_in_Detention (student_id INT64, detention_id INT64, incident_id INT64) CREATE TABLE Ref_Detention_Type (detention_type_code STRING, detention_type_description STRING) CREATE TABLE Addresses (address_id INT64, line_1 STRING, line_2 STRING, line_3 STRING, city STRING, zip_postcode STRING, state_province_county STRING, country STRING, other_address_details STRING) CREATE TABLE Detention (detention_id INT64, detention_type_code STRING, teacher_id INT64, datetime_detention_start DATETIME, datetime_detention_end DATETIME, detention_summary STRING, other_details STRING) CREATE TABLE Ref_Incident_Type (incident_type_code STRING, incident_type_description STRING) CREATE TABLE Ref_Address_Types (address_type_code STRING, address_type_description STRING)
Find the number of the dates of assessment notes for students with first name 'Fanny', I want to list by the how many date of notes in ascending.
SELECT date_of_notes, COUNT(date_of_notes) FROM Assessment_Notes AS T1 JOIN Students AS T2 ON T1.student_id = T2.student_id WHERE T2.first_name = "Fanny" ORDER BY COUNT(date_of_notes)
SELECT `date_of_notes`, COUNT(`date_of_notes`) FROM `Assessment_Notes` AS `T1` JOIN `Students` AS `T2` ON `Fanny` = `T2`.`first_name` AND `T1`.`student_id` = `T2`.`student_id` ORDER BY COUNT(`date_of_notes`)
0.202148
CREATE TABLE table_66643 (`Tie no` STRING, `Home team` STRING, `Score` STRING, `Away team` STRING, `Attendance` STRING)
What is the tie no that has southport as the away team?
SELECT "Tie no" FROM table_66643 WHERE "Away team" = 'southport'
SELECT `Tie no` FROM `table_66643` WHERE `Away team` = 'southport'
0.064453
CREATE TABLE table_22904752_1 (_number INT64, written_by STRING)
How many # were written by david hoselton?
SELECT MAX(_number) FROM table_22904752_1 WHERE written_by = "David Hoselton"
SELECT MAX(`_number`) FROM `table_22904752_1` WHERE `David Hoselton` = `written_by`
0.081055
CREATE TABLE table_34776 (`Nation` STRING, `Skip` STRING, `Third` STRING, `Second` STRING, `Lead` STRING, `Alternate` STRING)
Who is the lead for the team with Christina Haller as alternate?
SELECT "Lead" FROM table_34776 WHERE "Alternate" = 'christina haller'
SELECT `Lead` FROM `table_34776` WHERE `Alternate` = 'christina haller'
0.069336
CREATE TABLE table_44208 (`Round` FLOAT64, `Pick` FLOAT64, `Player` STRING, `Nationality` STRING, `School/Club Team` STRING)
What is Round, when School/Club Team is 'Tennessee-Chattanooga'?
SELECT "Round" FROM table_44208 WHERE "School/Club Team" = 'tennessee-chattanooga'
SELECT `Round` FROM `table_44208` WHERE `School/Club Team` = 'tennessee-chattanooga'
0.082031
CREATE TABLE table_name_52 (programming_language_used STRING, first_public_release STRING)
Which Programming language used has a First public release of 1997?
SELECT programming_language_used FROM table_name_52 WHERE first_public_release = "1997"
SELECT `programming_language_used` FROM `table_name_52` WHERE `1997` = `first_public_release`
0.09082
CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC)
in 2104 what were the five most frequent medications prescribed in the same month to the bladder ca female patients of age 60 or above after having been diagnosed with bladder ca?
SELECT t3.drugname FROM (SELECT t2.drugname, 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 = 'bladder ca' AND STRFTIME('%y', diagnosis.diagnosistime) = '2104') AS t1 JOIN (SELECT patient.uniquepid, medication.drugname, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE patient.gender = 'female' AND patient.age >= 60 AND STRFTIME('%y', medication.drugstarttime) = '2104') AS t2 ON t1.uniquepid = t2.uniquepid WHERE t1.diagnosistime < t2.drugstarttime AND DATETIME(t1.diagnosistime, 'start of month') = DATETIME(t2.drugstarttime, 'start of month') GROUP BY t2.drugname) AS t3 WHERE t3.c1 <= 5
WITH `t2` AS (SELECT `patient`.`uniquepid`, `medication`.`drugname`, `medication`.`drugstarttime` FROM `medication` JOIN `patient` ON `medication`.`patientunitstayid` = `patient`.`patientunitstayid` AND `patient`.`age` >= 60 AND `patient`.`gender` = 'female' WHERE STRFTIME('%y', `medication`.`drugstarttime`) = '2104'), `t3` AS (SELECT `t2`.`drugname`, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS `c1` FROM `diagnosis` JOIN `patient` ON `diagnosis`.`patientunitstayid` = `patient`.`patientunitstayid` JOIN `t2` AS `t2` ON `diagnosis`.`diagnosistime` < `t2`.`drugstarttime` AND `patient`.`uniquepid` = `t2`.`uniquepid` AND DATETIME(`diagnosis`.`diagnosistime`, 'start of month') = DATETIME(`t2`.`drugstarttime`, 'start of month') WHERE `diagnosis`.`diagnosisname` = 'bladder ca' AND STRFTIME('%y', `diagnosis`.`diagnosistime`) = '2104' GROUP BY `t2`.`drugname`) SELECT `t3`.`drugname` FROM `t3` AS `t3` WHERE `t3`.`c1` <= 5
0.90332
CREATE TABLE table_6018 (`Week` FLOAT64, `Date` STRING, `Time` STRING, `Opponent` STRING, `Result` STRING, `NFL Recap` STRING)
What was the time of the game that had an NFL recap and a result of W 22 16?
SELECT "Time" FROM table_6018 WHERE "NFL Recap" = 'recap' AND "Result" = 'w 22–16'
SELECT `Time` FROM `table_6018` WHERE `NFL Recap` = 'recap' AND `Result` = 'w 22–16'
0.082031
CREATE TABLE table_23594 (`Season` STRING, `Bayernliga` STRING, `Landesliga S\\u00fcd` STRING, `Landesliga Mitte` STRING, `Landesliga Nord` STRING)
Name the landesliga nord for asv neumarkt
SELECT "Landesliga Nord" FROM table_23594 WHERE "Landesliga Mitte" = 'ASV Neumarkt'
SELECT `Landesliga Nord` FROM `table_23594` WHERE `Landesliga Mitte` = 'ASV Neumarkt'
0.083008
CREATE TABLE table_name_23 (losses INT64, club STRING, points STRING)
What is the top losses that with Club of cd toledo and Points more than 56?
SELECT MAX(losses) FROM table_name_23 WHERE club = "cd toledo" AND points > 56
SELECT MAX(`losses`) FROM `table_name_23` WHERE `cd toledo` = `club` AND `points` > 56
0.083984
CREATE TABLE Reviewer (rID INT64, name STRING) CREATE TABLE Movie (mID INT64, title STRING, year INT64, director STRING) CREATE TABLE Rating (rID INT64, mID INT64, stars INT64, ratingDate DATE)
Visualize the title and their total smallest ratings of the movie using a bar chart, order y axis from low to high order.
SELECT T2.title, SUM(MIN(T1.stars)) FROM Rating AS T1 JOIN Movie AS T2 ON T1.mID = T2.mID GROUP BY T2.title ORDER BY SUM(MIN(T1.stars))
SELECT `T2`.`title`, SUM(MIN(`T1`.`stars`)) FROM `Rating` AS `T1` JOIN `Movie` AS `T2` ON `T1`.`mid` = `T2`.`mid` GROUP BY `T2`.`title` ORDER BY SUM(MIN(`T1`.`stars`))
0.163086
CREATE TABLE table_7057 (`Rank` STRING, `Nation` STRING, `Gold` FLOAT64, `Silver` FLOAT64, `Bronze` FLOAT64, `Total` FLOAT64)
What is the total of silver when gold is less than 0?
SELECT SUM("Silver") FROM table_7057 WHERE "Gold" < '0'
SELECT SUM(`Silver`) FROM `table_7057` WHERE `Gold` < '0'
0.055664
CREATE TABLE table_name_52 (date STRING, others STRING, psd___pc STRING)
When the other is n/a and the psc-pc is 30% what is the date?
SELECT date FROM table_name_52 WHERE others = "n/a" AND psd___pc = "30%"
SELECT `date` FROM `table_name_52` WHERE `30%` = `psd___pc` AND `n/a` = `others`
0.078125
CREATE TABLE course_offering (offering_id INT64, course_id INT64, semester INT64, section_number INT64, start_time TIME, end_time TIME, monday STRING, tuesday STRING, wednesday STRING, thursday STRING, friday STRING, saturday STRING, sunday STRING, has_final_project STRING, has_final_exam STRING, textbook STRING, class_address STRING, allow_audit STRING) CREATE TABLE gsi (course_offering_id INT64, student_id INT64) CREATE TABLE semester (semester_id INT64, semester STRING, year INT64) CREATE TABLE course_prerequisite (pre_course_id INT64, course_id INT64) CREATE TABLE ta (campus_job_id INT64, student_id INT64, location STRING) CREATE TABLE instructor (instructor_id INT64, name STRING, uniqname STRING) CREATE TABLE offering_instructor (offering_instructor_id INT64, offering_id INT64, instructor_id INT64) CREATE TABLE program_requirement (program_id INT64, category STRING, min_credit INT64, additional_req STRING) CREATE TABLE requirement (requirement_id INT64, requirement STRING, college STRING) CREATE TABLE course (course_id INT64, name STRING, department STRING, number STRING, credits STRING, advisory_requirement STRING, enforced_requirement STRING, description STRING, num_semesters INT64, num_enrolled INT64, has_discussion STRING, has_lab STRING, has_projects STRING, has_exams STRING, num_reviews INT64, clarity_score INT64, easiness_score INT64, helpfulness_score INT64) CREATE TABLE comment_instructor (instructor_id INT64, student_id INT64, score INT64, comment_text STRING) CREATE TABLE jobs (job_id INT64, job_title STRING, description STRING, requirement STRING, city STRING, state STRING, country STRING, zip INT64) CREATE TABLE program (program_id INT64, name STRING, college STRING, introduction STRING) CREATE TABLE student_record (student_id INT64, course_id INT64, semester INT64, grade STRING, how STRING, transfer_source STRING, earn_credit STRING, repeat_term STRING, test_id STRING) CREATE TABLE program_course (program_id INT64, course_id INT64, workload INT64, category STRING) CREATE TABLE student (student_id INT64, lastname STRING, firstname STRING, program_id INT64, declare_major STRING, total_credit INT64, total_gpa FLOAT64, entered_as STRING, admit_term INT64, predicted_graduation_semester INT64, degree STRING, minor STRING, internship STRING) CREATE TABLE course_tags_count (course_id INT64, clear_grading INT64, pop_quiz INT64, group_projects INT64, inspirational INT64, long_lectures INT64, extra_credit INT64, few_tests INT64, good_feedback INT64, tough_tests INT64, heavy_papers INT64, cares_for_students INT64, heavy_assignments INT64, respected INT64, participation INT64, heavy_reading INT64, tough_grader INT64, hilarious INT64, would_take_again INT64, good_lecture INT64, no_skip INT64) CREATE TABLE area (course_id INT64, area STRING)
Are there courses I need to take before PHYSED 265 ?
SELECT DISTINCT COURSE_0.department, COURSE_0.name, COURSE_0.number FROM course AS COURSE_0, course AS COURSE_1, course_prerequisite WHERE COURSE_0.course_id = course_prerequisite.pre_course_id AND NOT COURSE_0.course_id IN (SELECT STUDENT_RECORDalias0.course_id FROM student_record AS STUDENT_RECORDalias0 WHERE STUDENT_RECORDalias0.student_id = 1) AND COURSE_1.course_id = course_prerequisite.course_id AND COURSE_1.department = 'PHYSED' AND COURSE_1.number = 265
WITH `_u_0` AS (SELECT `STUDENT_RECORDalias0`.`course_id` FROM `student_record` AS `STUDENT_RECORDalias0` WHERE `STUDENT_RECORDalias0`.`student_id` = 1 GROUP BY `course_id`) SELECT DISTINCT `COURSE_0`.`department`, `COURSE_0`.`name`, `COURSE_0`.`number` FROM `course` AS `COURSE_0` LEFT JOIN `_u_0` AS `_u_0` ON `COURSE_0`.`course_id` = `_u_0`.`` JOIN `course_prerequisite` ON `COURSE_0`.`course_id` = `course_prerequisite`.`pre_course_id` JOIN `course` AS `COURSE_1` ON `COURSE_1`.`course_id` = `course_prerequisite`.`course_id` AND `COURSE_1`.`department` = 'PHYSED' AND `COURSE_1`.`number` = 265 WHERE `_u_0`.`` IS NULL
0.607422
CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
how many patients whose admission type is elective and insurance is medicare?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic WHERE demographic.admission_type = "ELECTIVE" AND demographic.insurance = "Medicare"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` WHERE `ELECTIVE` = `demographic`.`admission_type` AND `Medicare` = `demographic`.`insurance`
0.157227
CREATE TABLE table_name_25 (report STRING, circuit STRING)
Tell me the report for circuit of modena
SELECT report FROM table_name_25 WHERE circuit = "modena"
SELECT `report` FROM `table_name_25` WHERE `circuit` = `modena`
0.061523
CREATE TABLE table_24928 (`Name` STRING, `Position` STRING, `Height` STRING, `Weight` STRING, `Date of Birth` STRING, `Home Team` STRING)
If the height is 185cm and the home team is Heaton Mersey, what is the date of birth?
SELECT "Date of Birth" FROM table_24928 WHERE "Height" = '185cm' AND "Home Team" = 'Heaton Mersey'
SELECT `Date of Birth` FROM `table_24928` WHERE `Height` = '185cm' AND `Home Team` = 'Heaton Mersey'
0.097656
CREATE TABLE technician (technician_id FLOAT64, Name STRING, Team STRING, Starting_Year FLOAT64, Age INT64) CREATE TABLE machine (Machine_ID INT64, Making_Year INT64, Class STRING, Team STRING, Machine_series STRING, value_points FLOAT64, quality_rank INT64) CREATE TABLE repair (repair_ID INT64, name STRING, Launch_Date STRING, Notes STRING) CREATE TABLE repair_assignment (technician_id INT64, repair_ID INT64, Machine_ID INT64)
What are the names of the technicians and how many machines are they assigned to repair, show from high to low by the x axis.
SELECT Name, COUNT(*) FROM repair_assignment AS T1 JOIN technician AS T2 ON T1.technician_id = T2.technician_id GROUP BY T2.Name ORDER BY Name DESC
SELECT `Name`, COUNT(*) FROM `repair_assignment` AS `T1` JOIN `technician` AS `T2` ON `T1`.`technician_id` = `T2`.`technician_id` GROUP BY `T2`.`name` ORDER BY `Name` DESC
0.166992
CREATE TABLE table_43050 (`Volume` STRING, `Series` STRING, `Title` STRING, `Cover` STRING, `Published` STRING, `ISBN` STRING)
What cover has Throne of Aquilonia as the title?
SELECT "Cover" FROM table_43050 WHERE "Title" = 'throne of aquilonia'
SELECT `Cover` FROM `table_43050` WHERE `Title` = 'throne of aquilonia'
0.069336
CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING)
what's patient 021-111547's maximum value of cpk this month?
SELECT MAX(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 = '021-111547')) AND lab.labname = 'cpk' AND DATETIME(lab.labresulttime, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month')
WITH `_u_0` AS (SELECT `patient`.`patienthealthsystemstayid` FROM `patient` WHERE `patient`.`uniquepid` = '021-111547' GROUP BY `patienthealthsystemstayid`), `_u_1` AS (SELECT `patient`.`patientunitstayid` FROM `patient` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `patient`.`patienthealthsystemstayid` WHERE NOT `_u_0`.`` IS NULL GROUP BY `patientunitstayid`) SELECT MAX(`lab`.`labresult`) FROM `lab` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `lab`.`patientunitstayid` WHERE `lab`.`labname` = 'cpk' AND DATETIME(`lab`.`labresulttime`, 'start of month') = DATETIME(CURRENT_TIME(), 'start of month', '-0 month') AND NOT `_u_1`.`` IS NULL
0.619141
CREATE TABLE table_name_64 (league STRING, team STRING)
What league is ordabasy-2 in?
SELECT league FROM table_name_64 WHERE team = "ordabasy-2"
SELECT `league` FROM `table_name_64` WHERE `ordabasy-2` = `team`
0.0625
CREATE TABLE table_name_42 (years_of_operation STRING, area_of_operation STRING)
What years was El Mabrouk the area of operation?
SELECT years_of_operation FROM table_name_42 WHERE area_of_operation = "el mabrouk"
SELECT `years_of_operation` FROM `table_name_42` WHERE `area_of_operation` = `el mabrouk`
0.086914
CREATE TABLE table_9260 (`City` STRING, `Round 1` FLOAT64, `Round 2` STRING, `Round 3` STRING, `Round 4` STRING)
Round 3 with a round 4 of 50?
SELECT "Round 3" FROM table_9260 WHERE "Round 4" = '50'
SELECT `Round 3` FROM `table_9260` WHERE `Round 4` = '50'
0.055664
CREATE TABLE table_name_57 (score STRING, date STRING)
What score has February 10 as the date?
SELECT score FROM table_name_57 WHERE date = "february 10"
SELECT `score` FROM `table_name_57` WHERE `date` = `february 10`
0.0625
CREATE TABLE table_18808 (`Rank by average` FLOAT64, `Competition finish` FLOAT64, `Couple` STRING, `Total` FLOAT64, `Number of dances` FLOAT64, `Average` STRING)
tell the mean of the times competition for the 7 jigs
SELECT "Rank by average" FROM table_18808 WHERE "Number of dances" = '7'
SELECT `Rank by average` FROM `table_18808` WHERE `Number of dances` = '7'
0.072266
CREATE TABLE table_name_61 (round INT64, position STRING, pick__number STRING)
Let's say position was linebacker with a pick number less than 5, what was the highest round?
SELECT MAX(round) FROM table_name_61 WHERE position = "linebacker" AND pick__number > 5
SELECT MAX(`round`) FROM `table_name_61` WHERE `linebacker` = `position` AND `pick__number` > 5
0.092773
CREATE TABLE table_71792 (`Rank` FLOAT64, `Heat` FLOAT64, `Lane` FLOAT64, `Name` STRING, `Nationality` STRING, `Time` STRING)
What are the total lanes that have a rank larger than 22?
SELECT SUM("Lane") FROM table_71792 WHERE "Rank" > '22'
SELECT SUM(`Lane`) FROM `table_71792` WHERE `Rank` > '22'
0.055664
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING)
which patients have lab test item id 50802?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE lab.itemid = "50802"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `lab` ON `50802` = `lab`.`itemid` AND `demographic`.`hadm_id` = `lab`.`hadm_id`
0.149414
CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype STRING, careunit STRING, wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC) CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type STRING, admission_location STRING, discharge_location STRING, insurance STRING, language STRING, marital_status STRING, ethnicity STRING, age NUMERIC) CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit STRING, last_careunit STRING, first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type STRING, event_id NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC) CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc STRING, org_name STRING) CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender STRING, dob TIME, dod TIME) CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label STRING, linksto STRING) CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug STRING, dose_val_rx STRING, dose_unit_rx STRING, route STRING) CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label STRING)
how many patients were since 5 years ago in the sicu careunit.
SELECT COUNT(DISTINCT admissions.subject_id) FROM admissions WHERE admissions.hadm_id IN (SELECT transfers.hadm_id FROM transfers WHERE transfers.careunit = 'sicu' AND DATETIME(transfers.intime) >= DATETIME(CURRENT_TIME(), '-5 year'))
WITH `_u_0` AS (SELECT `transfers`.`hadm_id` FROM `transfers` WHERE `transfers`.`careunit` = 'sicu' AND DATETIME(`transfers`.`intime`) >= DATETIME(CURRENT_TIME(), '-5 year') GROUP BY `hadm_id`) SELECT COUNT(DISTINCT `admissions`.`subject_id`) FROM `admissions` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `admissions`.`hadm_id` WHERE NOT `_u_0`.`` IS NULL
0.344727
CREATE TABLE table_17156199_1 (year__ceremony_ STRING, original_title STRING)
How many years was the original title was (swopnodanay)?
SELECT COUNT(year__ceremony_) FROM table_17156199_1 WHERE original_title = "স্বপ্নডানায় (Swopnodanay)"
SELECT COUNT(`year__ceremony_`) FROM `table_17156199_1` WHERE `original_title` = `স্বপ্নডানায় (Swopnodanay)`
0.106445
CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING)
calculate the one year survival rate among the patients who were prescribed with propofol 10 mg/ml after having been diagnosed with swollen extremity, etiology unknown - r/o cellulitis.
SELECT SUM(CASE WHEN patient.hospitaldischargestatus = 'alive' THEN 1 WHEN STRFTIME('%j', patient.hospitaldischargetime) - STRFTIME('%j', t4.diagnosistime) > 1 * 365 THEN 1 ELSE 0 END) * 100 / COUNT(*) FROM (SELECT t2.uniquepid, t2.diagnosistime FROM (SELECT t1.uniquepid, t1.diagnosistime FROM (SELECT patient.uniquepid, diagnosis.diagnosistime FROM diagnosis JOIN patient ON diagnosis.patientunitstayid = patient.patientunitstayid WHERE diagnosis.diagnosisname = 'swollen extremity, etiology unknown - r/o cellulitis' GROUP BY patient.uniquepid HAVING MIN(diagnosis.diagnosistime) = diagnosis.diagnosistime) AS t1) AS t2 JOIN (SELECT patient.uniquepid, medication.drugstarttime FROM medication JOIN patient ON medication.patientunitstayid = patient.patientunitstayid WHERE medication.drugname = 'propofol 10 mg/ml') AS t3 ON t2.uniquepid = t3.uniquepid WHERE t2.diagnosistime < t3.drugstarttime) AS t4 JOIN patient ON t4.uniquepid = patient.uniquepid
WITH `t1` AS (SELECT `patient`.`uniquepid`, `diagnosis`.`diagnosistime` FROM `diagnosis` JOIN `patient` ON `diagnosis`.`patientunitstayid` = `patient`.`patientunitstayid` WHERE `diagnosis`.`diagnosisname` = 'swollen extremity, etiology unknown - r/o cellulitis' GROUP BY `patient`.`uniquepid` HAVING `diagnosis`.`diagnosistime` = MIN(`diagnosis`.`diagnosistime`)), `t3` AS (SELECT `patient`.`uniquepid`, `medication`.`drugstarttime` FROM `medication` JOIN `patient` ON `medication`.`patientunitstayid` = `patient`.`patientunitstayid` WHERE `medication`.`drugname` = 'propofol 10 mg/ml') SELECT SUM(CASE WHEN `patient`.`hospitaldischargestatus` = 'alive' THEN 1 WHEN STRFTIME('%j', `patient`.`hospitaldischargetime`) - STRFTIME('%j', `t1`.`diagnosistime`) > 365 THEN 1 ELSE 0 END) * 100 / NULLIF(COUNT(*), 0) FROM `t1` AS `t1` JOIN `t3` AS `t3` ON `t1`.`diagnosistime` < `t3`.`drugstarttime` AND `t1`.`uniquepid` = `t3`.`uniquepid` JOIN `patient` ON `patient`.`uniquepid` = `t1`.`uniquepid`
0.96582
CREATE TABLE table_55465 (`Driver` STRING, `Constructor` STRING, `Laps` FLOAT64, `Time/Retired` STRING, `Grid` FLOAT64)
who is the constructor when the laps is less than 68, the grid is more than 20 and the driver is thierry boutsen?
SELECT "Constructor" FROM table_55465 WHERE "Laps" < '68' AND "Grid" > '20' AND "Driver" = 'thierry boutsen'
SELECT `Constructor` FROM `table_55465` WHERE `Driver` = 'thierry boutsen' AND `Grid` > '20' AND `Laps` < '68'
0.107422
CREATE TABLE table_20531 (`Institution` STRING, `Location` STRING, `Founded` FLOAT64, `Affiliation` STRING, `Enrollment` FLOAT64, `Team Nickname` STRING, `Primary conference` STRING)
Where is the university located that's nicknamed the Wolves?
SELECT "Location" FROM table_20531 WHERE "Team Nickname" = 'Wolves'
SELECT `Location` FROM `table_20531` WHERE `Team Nickname` = 'Wolves'
0.067383
CREATE TABLE table_29310 (`Team` STRING, `Home Gms` FLOAT64, `Home Total` FLOAT64, `Home Avg` FLOAT64, `Top Home Crowd` STRING, `Road Gms` FLOAT64, `Road Total` FLOAT64, `Road Avg` FLOAT64, `Overall Gms` FLOAT64, `Overall Total` FLOAT64, `Overall Avg` FLOAT64)
What was the highest home total?
SELECT MAX("Home Total") FROM table_29310
SELECT MAX(`Home Total`) FROM `table_29310`
0.041992
CREATE TABLE CloseAsOffTopicReasonTypes (Id NUMERIC, IsUniversal BOOL, InputTitle STRING, MarkdownInputGuidance STRING, MarkdownPostOwnerGuidance STRING, MarkdownPrivilegedUserGuidance STRING, MarkdownConcensusDescription STRING, CreationDate TIME, CreationModeratorId NUMERIC, ApprovalDate TIME, ApprovalModeratorId NUMERIC, DeactivationDate TIME, DeactivationModeratorId NUMERIC) CREATE TABLE PendingFlags (Id NUMERIC, FlagTypeId NUMERIC, PostId NUMERIC, CreationDate TIME, CloseReasonTypeId NUMERIC, CloseAsOffTopicReasonTypeId NUMERIC, DuplicateOfQuestionId NUMERIC, BelongsOnBaseHostAddress STRING) CREATE TABLE ReviewRejectionReasons (Id NUMERIC, Name STRING, Description STRING, PostTypeId NUMERIC) CREATE TABLE TagSynonyms (Id NUMERIC, SourceTagName STRING, TargetTagName STRING, CreationDate TIME, OwnerUserId NUMERIC, AutoRenameCount NUMERIC, LastAutoRename TIME, Score NUMERIC, ApprovedByUserId NUMERIC, ApprovalDate TIME) CREATE TABLE Users (Id NUMERIC, Reputation NUMERIC, CreationDate TIME, DisplayName STRING, LastAccessDate TIME, WebsiteUrl STRING, Location STRING, AboutMe STRING, Views NUMERIC, UpVotes NUMERIC, DownVotes NUMERIC, ProfileImageUrl STRING, EmailHash STRING, AccountId NUMERIC) CREATE TABLE PostTypes (Id NUMERIC, Name STRING) CREATE TABLE ReviewTaskStates (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE SuggestedEditVotes (Id NUMERIC, SuggestedEditId NUMERIC, UserId NUMERIC, VoteTypeId NUMERIC, CreationDate TIME, TargetUserId NUMERIC, TargetRepChange NUMERIC) CREATE TABLE Comments (Id NUMERIC, PostId NUMERIC, Score NUMERIC, Text STRING, CreationDate TIME, UserDisplayName STRING, UserId NUMERIC, ContentLicense STRING) CREATE TABLE PostsWithDeleted (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE Posts (Id NUMERIC, PostTypeId NUMERIC, AcceptedAnswerId NUMERIC, ParentId NUMERIC, CreationDate TIME, DeletionDate TIME, Score NUMERIC, ViewCount NUMERIC, Body STRING, OwnerUserId NUMERIC, OwnerDisplayName STRING, LastEditorUserId NUMERIC, LastEditorDisplayName STRING, LastEditDate TIME, LastActivityDate TIME, Title STRING, Tags STRING, AnswerCount NUMERIC, CommentCount NUMERIC, FavoriteCount NUMERIC, ClosedDate TIME, CommunityOwnedDate TIME, ContentLicense STRING) CREATE TABLE Votes (Id NUMERIC, PostId NUMERIC, VoteTypeId NUMERIC, UserId NUMERIC, CreationDate TIME, BountyAmount NUMERIC) CREATE TABLE PostNotices (Id NUMERIC, PostId NUMERIC, PostNoticeTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ExpiryDate TIME, Body STRING, OwnerUserId NUMERIC, DeletionUserId NUMERIC) CREATE TABLE PostHistory (Id NUMERIC, PostHistoryTypeId NUMERIC, PostId NUMERIC, RevisionGUID other, CreationDate TIME, UserId NUMERIC, UserDisplayName STRING, Comment STRING, Text STRING, ContentLicense STRING) CREATE TABLE Badges (Id NUMERIC, UserId NUMERIC, Name STRING, Date TIME, Class NUMERIC, TagBased BOOL) CREATE TABLE FlagTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostFeedback (Id NUMERIC, PostId NUMERIC, IsAnonymous BOOL, VoteTypeId NUMERIC, CreationDate TIME) CREATE TABLE ReviewTaskResults (Id NUMERIC, ReviewTaskId NUMERIC, ReviewTaskResultTypeId NUMERIC, CreationDate TIME, RejectionReasonId NUMERIC, Comment STRING) CREATE TABLE PostTags (PostId NUMERIC, TagId NUMERIC) CREATE TABLE ReviewTaskTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE PostLinks (Id NUMERIC, CreationDate TIME, PostId NUMERIC, RelatedPostId NUMERIC, LinkTypeId NUMERIC) CREATE TABLE PostNoticeTypes (Id NUMERIC, ClassId NUMERIC, Name STRING, Body STRING, IsHidden BOOL, Predefined BOOL, PostNoticeDurationId NUMERIC) CREATE TABLE ReviewTasks (Id NUMERIC, ReviewTaskTypeId NUMERIC, CreationDate TIME, DeletionDate TIME, ReviewTaskStateId NUMERIC, PostId NUMERIC, SuggestedEditId NUMERIC, CompletedByReviewTaskId NUMERIC) CREATE TABLE CloseReasonTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE ReviewTaskResultTypes (Id NUMERIC, Name STRING, Description STRING) CREATE TABLE SuggestedEdits (Id NUMERIC, PostId NUMERIC, CreationDate TIME, ApprovalDate TIME, RejectionDate TIME, OwnerUserId NUMERIC, Comment STRING, Text STRING, Title STRING, Tags STRING, RevisionGUID other) CREATE TABLE PostHistoryTypes (Id NUMERIC, Name STRING) CREATE TABLE Tags (Id NUMERIC, TagName STRING, Count NUMERIC, ExcerptPostId NUMERIC, WikiPostId NUMERIC) CREATE TABLE VoteTypes (Id NUMERIC, Name STRING)
Questions marked as duplicate without solved(WIP: Not Complete).
/* SELECT * FROM POSTS PS WHERE PS.ID IN ( SELECT SUBSTRING(PH.Text,24,CHARINDEX(PH.Text, ']')) FROM Posts P INNER JOIN PostHistory PH ON P.Id=PH.PostId AND PH.PostHistoryTypeId =10 AND PH.Comment=1 WHERE P.ClosedDate IS NOT NULL ) */ SELECT SUBSTRING(PH.Text, STR_POSITION(ph.Text, ''), STR_POSITION(PH.Text, '')) FROM Posts AS P INNER JOIN PostHistory AS PH ON P.Id = PH.PostId AND PH.PostHistoryTypeId = 10 AND PH.Comment = 1 WHERE NOT P.ClosedDate IS NULL
/* SELECT * FROM POSTS PS WHERE PS.ID IN ( SELECT SUBSTRING(PH.Text,24,CHARINDEX(PH.Text, ']')) FROM Posts P INNER JOIN PostHistory PH ON P.Id=PH.PostId AND PH.PostHistoryTypeId =10 AND PH.Comment=1 WHERE P.ClosedDate IS NOT NULL ) */ SELECT SUBSTRING(`PH`.`text`, STR_POSITION(`ph`.`Text`, ''), STR_POSITION(`PH`.`text`, '')) FROM `Posts` AS `P` JOIN `PostHistory` AS `PH` ON `P`.`id` = `PH`.`postid` AND `PH`.`comment` = 1 AND `PH`.`posthistorytypeid` = 10 WHERE NOT `P`.`closeddate` IS NULL
0.481445
CREATE TABLE table_1181375_1 (notes STRING, withdrawn STRING)
what's the notes where withdrawn is 1956 57
SELECT notes FROM table_1181375_1 WHERE withdrawn = "1956–57"
SELECT `notes` FROM `table_1181375_1` WHERE `1956–57` = `withdrawn`
0.06543
CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC) CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type STRING, event_id NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type STRING, admission_location STRING, discharge_location STRING, insurance STRING, language STRING, marital_status STRING, ethnicity STRING, age NUMERIC) CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype STRING, careunit STRING, wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label STRING, linksto STRING) CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc STRING, org_name STRING) CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label STRING) CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender STRING, dob TIME, dod TIME) CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC) CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug STRING, dose_val_rx STRING, dose_unit_rx STRING, route STRING) CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit STRING, last_careunit STRING, first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING)
when they visited the hospital first time, had ipratropium bromide neb ever been prescribed to patient 60347?
SELECT COUNT(*) > 0 FROM prescriptions WHERE prescriptions.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.subject_id = 60347 AND NOT admissions.dischtime IS NULL ORDER BY admissions.admittime LIMIT 1) AND prescriptions.drug = 'ipratropium bromide neb'
SELECT COUNT(*) > 0 FROM `prescriptions` WHERE `prescriptions`.`drug` = 'ipratropium bromide neb' AND `prescriptions`.`hadm_id` IN (SELECT `admissions`.`hadm_id` FROM `admissions` WHERE `admissions`.`subject_id` = 60347 AND NOT `admissions`.`dischtime` IS NULL ORDER BY `admissions`.`admittime` LIMIT 1)
0.295898
CREATE TABLE table_4993 (`Version` STRING, `Length` STRING, `Album` STRING, `Remixed by` STRING, `Year` FLOAT64)
What is the total number of Year that has an Album of Remixes?
SELECT SUM("Year") FROM table_4993 WHERE "Album" = 'remixes'
SELECT SUM(`Year`) FROM `table_4993` WHERE `Album` = 'remixes'
0.060547
CREATE TABLE table_204_323 (id NUMERIC, `year` NUMERIC, `film` STRING, `function` STRING, `notes` STRING)
how many films did ms. starfelt produce after 2010 ?
SELECT COUNT("film") FROM table_204_323 WHERE "year" > 2010
SELECT COUNT(`film`) FROM `table_204_323` WHERE `year` > 2010
0.05957
CREATE TABLE table_45909 (`Winner` STRING, `Country` STRING, `Winter Olympics` STRING, `FIS Nordic World Ski Championships` STRING, `Holmenkollen` STRING)
Which Holmenkollen has a Country of norway, and a Winner of tom sandberg?
SELECT "Holmenkollen" FROM table_45909 WHERE "Country" = 'norway' AND "Winner" = 'tom sandberg'
SELECT `Holmenkollen` FROM `table_45909` WHERE `Country` = 'norway' AND `Winner` = 'tom sandberg'
0.094727
CREATE TABLE table_23547 (`#` STRING, `Original title` STRING, `Directed by` STRING, `Written by` STRING, `Original airdate` STRING, `Production code` STRING)
What was the original title of 3.19?
SELECT "Original title" FROM table_23547 WHERE "Production code" = '3.19'
SELECT `Original title` FROM `table_23547` WHERE `Production code` = '3.19'
0.073242
CREATE TABLE table_22597626_2 (surface STRING, partner STRING, opponents_in_the_final STRING)
If the opponents in the final is Hewitt McMillan and the partner is Fleming, what is the surface?
SELECT surface FROM table_22597626_2 WHERE partner = "Fleming" AND opponents_in_the_final = "Hewitt McMillan"
SELECT `surface` FROM `table_22597626_2` WHERE `Fleming` = `partner` AND `Hewitt McMillan` = `opponents_in_the_final`
0.114258
CREATE TABLE diagnosis (diagnosisid NUMERIC, patientunitstayid NUMERIC, diagnosisname STRING, diagnosistime TIME, icd9code STRING) CREATE TABLE intakeoutput (intakeoutputid NUMERIC, patientunitstayid NUMERIC, cellpath STRING, celllabel STRING, cellvaluenumeric NUMERIC, intakeoutputtime TIME) CREATE TABLE microlab (microlabid NUMERIC, patientunitstayid NUMERIC, culturesite STRING, organism STRING, culturetakentime TIME) CREATE TABLE patient (uniquepid STRING, patienthealthsystemstayid NUMERIC, patientunitstayid NUMERIC, gender STRING, age STRING, ethnicity STRING, hospitalid NUMERIC, wardid NUMERIC, admissionheight NUMERIC, admissionweight NUMERIC, dischargeweight NUMERIC, hospitaladmittime TIME, hospitaladmitsource STRING, unitadmittime TIME, unitdischargetime TIME, hospitaldischargetime TIME, hospitaldischargestatus STRING) CREATE TABLE lab (labid NUMERIC, patientunitstayid NUMERIC, labname STRING, labresult NUMERIC, labresulttime TIME) CREATE TABLE medication (medicationid NUMERIC, patientunitstayid NUMERIC, drugname STRING, dosage STRING, routeadmin STRING, drugstarttime TIME, drugstoptime TIME) CREATE TABLE allergy (allergyid NUMERIC, patientunitstayid NUMERIC, drugname STRING, allergyname STRING, allergytime TIME) CREATE TABLE treatment (treatmentid NUMERIC, patientunitstayid NUMERIC, treatmentname STRING, treatmenttime TIME) CREATE TABLE cost (costid NUMERIC, uniquepid STRING, patienthealthsystemstayid NUMERIC, eventtype STRING, eventid NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE vitalperiodic (vitalperiodicid NUMERIC, patientunitstayid NUMERIC, temperature NUMERIC, sao2 NUMERIC, heartrate NUMERIC, respiration NUMERIC, systemicsystolic NUMERIC, systemicdiastolic NUMERIC, systemicmean NUMERIC, observationtime TIME)
count the number of times patient 012-37411 had had a urine output on 12/29/this year.
SELECT COUNT(*) FROM intakeoutput WHERE intakeoutput.patientunitstayid IN (SELECT patient.patientunitstayid FROM patient WHERE patient.patienthealthsystemstayid IN (SELECT patient.patienthealthsystemstayid FROM patient WHERE patient.uniquepid = '012-37411')) AND intakeoutput.cellpath LIKE '%output%' AND intakeoutput.celllabel = 'urine' AND DATETIME(intakeoutput.intakeoutputtime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND STRFTIME('%m-%d', intakeoutput.intakeoutputtime) = '12-29'
WITH `_u_0` AS (SELECT `patient`.`patienthealthsystemstayid` FROM `patient` WHERE `patient`.`uniquepid` = '012-37411' GROUP BY `patienthealthsystemstayid`), `_u_1` AS (SELECT `patient`.`patientunitstayid` FROM `patient` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `patient`.`patienthealthsystemstayid` WHERE NOT `_u_0`.`` IS NULL GROUP BY `patientunitstayid`) SELECT COUNT(*) FROM `intakeoutput` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `intakeoutput`.`patientunitstayid` WHERE `intakeoutput`.`celllabel` = 'urine' AND `intakeoutput`.`cellpath` LIKE '%output%' AND DATETIME(`intakeoutput`.`intakeoutputtime`, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-0 year') AND NOT `_u_1`.`` IS NULL AND STRFTIME('%m-%d', `intakeoutput`.`intakeoutputtime`) = '12-29'
0.753906
CREATE TABLE offering_instructor (offering_instructor_id INT64, offering_id INT64, instructor_id INT64) CREATE TABLE student (student_id INT64, lastname STRING, firstname STRING, program_id INT64, declare_major STRING, total_credit INT64, total_gpa FLOAT64, entered_as STRING, admit_term INT64, predicted_graduation_semester INT64, degree STRING, minor STRING, internship STRING) CREATE TABLE course_offering (offering_id INT64, course_id INT64, semester INT64, section_number INT64, start_time TIME, end_time TIME, monday STRING, tuesday STRING, wednesday STRING, thursday STRING, friday STRING, saturday STRING, sunday STRING, has_final_project STRING, has_final_exam STRING, textbook STRING, class_address STRING, allow_audit STRING) CREATE TABLE student_record (student_id INT64, course_id INT64, semester INT64, grade STRING, how STRING, transfer_source STRING, earn_credit STRING, repeat_term STRING, test_id STRING) CREATE TABLE instructor (instructor_id INT64, name STRING, uniqname STRING) CREATE TABLE jobs (job_id INT64, job_title STRING, description STRING, requirement STRING, city STRING, state STRING, country STRING, zip INT64) CREATE TABLE program (program_id INT64, name STRING, college STRING, introduction STRING) CREATE TABLE program_requirement (program_id INT64, category STRING, min_credit INT64, additional_req STRING) CREATE TABLE course (course_id INT64, name STRING, department STRING, number STRING, credits STRING, advisory_requirement STRING, enforced_requirement STRING, description STRING, num_semesters INT64, num_enrolled INT64, has_discussion STRING, has_lab STRING, has_projects STRING, has_exams STRING, num_reviews INT64, clarity_score INT64, easiness_score INT64, helpfulness_score INT64) CREATE TABLE semester (semester_id INT64, semester STRING, year INT64) CREATE TABLE course_tags_count (course_id INT64, clear_grading INT64, pop_quiz INT64, group_projects INT64, inspirational INT64, long_lectures INT64, extra_credit INT64, few_tests INT64, good_feedback INT64, tough_tests INT64, heavy_papers INT64, cares_for_students INT64, heavy_assignments INT64, respected INT64, participation INT64, heavy_reading INT64, tough_grader INT64, hilarious INT64, would_take_again INT64, good_lecture INT64, no_skip INT64) CREATE TABLE area (course_id INT64, area STRING) CREATE TABLE program_course (program_id INT64, course_id INT64, workload INT64, category STRING) CREATE TABLE requirement (requirement_id INT64, requirement STRING, college STRING) CREATE TABLE ta (campus_job_id INT64, student_id INT64, location STRING) CREATE TABLE course_prerequisite (pre_course_id INT64, course_id INT64) CREATE TABLE comment_instructor (instructor_id INT64, student_id INT64, score INT64, comment_text STRING) CREATE TABLE gsi (course_offering_id INT64, student_id INT64)
Is it on Friday when Prof. Elmas Irmak 's classes always meet ?
SELECT COUNT(*) = 0 FROM course INNER JOIN course_offering ON course.course_id = course_offering.course_id INNER JOIN offering_instructor ON offering_instructor.offering_id = course_offering.offering_id INNER JOIN instructor ON offering_instructor.instructor_id = instructor.instructor_id WHERE course_offering.friday = 'N' AND instructor.name LIKE '%Elmas Irmak%'
SELECT COUNT(*) = 0 FROM `course` JOIN `course_offering` ON `course`.`course_id` = `course_offering`.`course_id` AND `course_offering`.`friday` = 'N' JOIN `offering_instructor` ON `course_offering`.`offering_id` = `offering_instructor`.`offering_id` JOIN `instructor` ON `instructor`.`instructor_id` = `offering_instructor`.`instructor_id` AND `instructor`.`name` LIKE '%Elmas Irmak%'
0.375
CREATE TABLE comment_instructor (instructor_id INT64, student_id INT64, score INT64, comment_text STRING) CREATE TABLE course_prerequisite (pre_course_id INT64, course_id INT64) CREATE TABLE course_offering (offering_id INT64, course_id INT64, semester INT64, section_number INT64, start_time TIME, end_time TIME, monday STRING, tuesday STRING, wednesday STRING, thursday STRING, friday STRING, saturday STRING, sunday STRING, has_final_project STRING, has_final_exam STRING, textbook STRING, class_address STRING, allow_audit STRING) CREATE TABLE ta (campus_job_id INT64, student_id INT64, location STRING) CREATE TABLE area (course_id INT64, area STRING) CREATE TABLE course_tags_count (course_id INT64, clear_grading INT64, pop_quiz INT64, group_projects INT64, inspirational INT64, long_lectures INT64, extra_credit INT64, few_tests INT64, good_feedback INT64, tough_tests INT64, heavy_papers INT64, cares_for_students INT64, heavy_assignments INT64, respected INT64, participation INT64, heavy_reading INT64, tough_grader INT64, hilarious INT64, would_take_again INT64, good_lecture INT64, no_skip INT64) CREATE TABLE jobs (job_id INT64, job_title STRING, description STRING, requirement STRING, city STRING, state STRING, country STRING, zip INT64) CREATE TABLE requirement (requirement_id INT64, requirement STRING, college STRING) CREATE TABLE student (student_id INT64, lastname STRING, firstname STRING, program_id INT64, declare_major STRING, total_credit INT64, total_gpa FLOAT64, entered_as STRING, admit_term INT64, predicted_graduation_semester INT64, degree STRING, minor STRING, internship STRING) CREATE TABLE program_requirement (program_id INT64, category STRING, min_credit INT64, additional_req STRING) CREATE TABLE student_record (student_id INT64, course_id INT64, semester INT64, grade STRING, how STRING, transfer_source STRING, earn_credit STRING, repeat_term STRING, test_id STRING) CREATE TABLE semester (semester_id INT64, semester STRING, year INT64) CREATE TABLE program (program_id INT64, name STRING, college STRING, introduction STRING) CREATE TABLE course (course_id INT64, name STRING, department STRING, number STRING, credits STRING, advisory_requirement STRING, enforced_requirement STRING, description STRING, num_semesters INT64, num_enrolled INT64, has_discussion STRING, has_lab STRING, has_projects STRING, has_exams STRING, num_reviews INT64, clarity_score INT64, easiness_score INT64, helpfulness_score INT64) CREATE TABLE program_course (program_id INT64, course_id INT64, workload INT64, category STRING) CREATE TABLE offering_instructor (offering_instructor_id INT64, offering_id INT64, instructor_id INT64) CREATE TABLE instructor (instructor_id INT64, name STRING, uniqname STRING) CREATE TABLE gsi (course_offering_id INT64, student_id INT64)
Are there any courses that are worth 6 credits ?
SELECT DISTINCT name, number FROM course WHERE credits = 6 AND department = 'EECS'
SELECT DISTINCT `name`, `number` FROM `course` WHERE `credits` = 6 AND `department` = 'EECS'
0.089844
CREATE TABLE table_45813 (`Place` STRING, `Player` STRING, `Country` STRING, `Score` STRING, `To par` STRING)
Mike Reid from the United States has what score?
SELECT "Score" FROM table_45813 WHERE "Country" = 'united states' AND "Player" = 'mike reid'
SELECT `Score` FROM `table_45813` WHERE `Country` = 'united states' AND `Player` = 'mike reid'
0.091797
CREATE TABLE table_59187 (`Place` STRING, `Player` STRING, `Country` STRING, `Score` STRING, `To par` STRING, `Money ( \\u00a3 ) ` FLOAT64)
What is the average money ( ) that has +8 as the to par, with 73-72-72-71=288 as the score?
SELECT AVG("Money ( \u00a3 )") FROM table_59187 WHERE "To par" = '+8' AND "Score" = '73-72-72-71=288'
SELECT AVG(`Money ( \u00a3 )`) FROM `table_59187` WHERE `Score` = '73-72-72-71=288' AND `To par` = '+8'
0.100586
CREATE TABLE outputevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, value NUMERIC) CREATE TABLE microbiologyevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, charttime TIME, spec_type_desc STRING, org_name STRING) CREATE TABLE d_icd_procedures (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE procedures_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE labevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE d_labitems (row_id NUMERIC, itemid NUMERIC, label STRING) CREATE TABLE chartevents (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, itemid NUMERIC, charttime TIME, valuenum NUMERIC, valueuom STRING) CREATE TABLE d_items (row_id NUMERIC, itemid NUMERIC, label STRING, linksto STRING) CREATE TABLE prescriptions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, startdate TIME, enddate TIME, drug STRING, dose_val_rx STRING, dose_unit_rx STRING, route STRING) CREATE TABLE diagnoses_icd (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icd9_code STRING, charttime TIME) CREATE TABLE d_icd_diagnoses (row_id NUMERIC, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE cost (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, event_type STRING, event_id NUMERIC, chargetime TIME, cost NUMERIC) CREATE TABLE icustays (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, first_careunit STRING, last_careunit STRING, first_wardid NUMERIC, last_wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE transfers (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, eventtype STRING, careunit STRING, wardid NUMERIC, intime TIME, outtime TIME) CREATE TABLE admissions (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, admittime TIME, dischtime TIME, admission_type STRING, admission_location STRING, discharge_location STRING, insurance STRING, language STRING, marital_status STRING, ethnicity STRING, age NUMERIC) CREATE TABLE inputevents_cv (row_id NUMERIC, subject_id NUMERIC, hadm_id NUMERIC, icustay_id NUMERIC, charttime TIME, itemid NUMERIC, amount NUMERIC) CREATE TABLE patients (row_id NUMERIC, subject_id NUMERIC, gender STRING, dob TIME, dod TIME)
tell me what are the top five most common diagnoses of patients with a 40s age during the previous year?
SELECT d_icd_diagnoses.short_title FROM d_icd_diagnoses WHERE d_icd_diagnoses.icd9_code IN (SELECT t1.icd9_code FROM (SELECT diagnoses_icd.icd9_code, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS c1 FROM diagnoses_icd WHERE diagnoses_icd.hadm_id IN (SELECT admissions.hadm_id FROM admissions WHERE admissions.age BETWEEN 40 AND 49) AND DATETIME(diagnoses_icd.charttime, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') GROUP BY diagnoses_icd.icd9_code) AS t1 WHERE t1.c1 <= 5)
WITH `_u_0` AS (SELECT `admissions`.`hadm_id` FROM `admissions` WHERE `admissions`.`age` <= 49 AND `admissions`.`age` >= 40 GROUP BY `hadm_id`), `t1` AS (SELECT `diagnoses_icd`.`icd9_code`, DENSE_RANK() OVER (ORDER BY COUNT(*) DESC) AS `c1` FROM `diagnoses_icd` LEFT JOIN `_u_0` AS `_u_0` ON `_u_0`.`` = `diagnoses_icd`.`hadm_id` WHERE DATETIME(`diagnoses_icd`.`charttime`, 'start of year') = DATETIME(CURRENT_TIME(), 'start of year', '-1 year') AND NOT `_u_0`.`` IS NULL GROUP BY `diagnoses_icd`.`icd9_code`), `_u_1` AS (SELECT `t1`.`icd9_code` FROM `t1` AS `t1` WHERE `t1`.`c1` <= 5 GROUP BY `icd9_code`) SELECT `d_icd_diagnoses`.`short_title` FROM `d_icd_diagnoses` LEFT JOIN `_u_1` AS `_u_1` ON `_u_1`.`` = `d_icd_diagnoses`.`icd9_code` WHERE NOT `_u_1`.`` IS NULL
0.75
CREATE TABLE staff (staff_id NUMERIC, first_name STRING, last_name STRING, address_id NUMERIC, picture others, email STRING, store_id NUMERIC, active BOOL, username STRING, password STRING, last_update TIME) CREATE TABLE actor (actor_id NUMERIC, first_name STRING, last_name STRING, last_update TIME) CREATE TABLE film_actor (actor_id NUMERIC, film_id NUMERIC, last_update TIME) CREATE TABLE film (film_id NUMERIC, title STRING, description STRING, release_year TIME, language_id NUMERIC, original_language_id NUMERIC, rental_duration NUMERIC, rental_rate NUMERIC, length NUMERIC, replacement_cost NUMERIC, rating STRING, special_features STRING, last_update TIME) CREATE TABLE payment (payment_id NUMERIC, customer_id NUMERIC, staff_id NUMERIC, rental_id NUMERIC, amount NUMERIC, payment_date TIME, last_update TIME) CREATE TABLE store (store_id NUMERIC, manager_staff_id NUMERIC, address_id NUMERIC, last_update TIME) CREATE TABLE category (category_id NUMERIC, name STRING, last_update TIME) CREATE TABLE rental (rental_id NUMERIC, rental_date TIME, inventory_id NUMERIC, customer_id NUMERIC, return_date TIME, staff_id NUMERIC, last_update TIME) CREATE TABLE film_category (film_id NUMERIC, category_id NUMERIC, last_update TIME) CREATE TABLE customer (customer_id NUMERIC, store_id NUMERIC, first_name STRING, last_name STRING, email STRING, address_id NUMERIC, active BOOL, create_date TIME, last_update TIME) CREATE TABLE country (country_id NUMERIC, country STRING, last_update TIME) CREATE TABLE address (address_id NUMERIC, address STRING, address2 STRING, district STRING, city_id NUMERIC, postal_code STRING, phone STRING, last_update TIME) CREATE TABLE city (city_id NUMERIC, city STRING, country_id NUMERIC, last_update TIME) CREATE TABLE film_text (film_id NUMERIC, title STRING, description STRING) CREATE TABLE language (language_id NUMERIC, name STRING, last_update TIME) CREATE TABLE inventory (inventory_id NUMERIC, film_id NUMERIC, store_id NUMERIC, last_update TIME)
What are the countries that contain 3 or more cities?
SELECT T2.country FROM city AS T1 JOIN country AS T2 ON T1.country_id = T2.country_id GROUP BY T2.country_id HAVING COUNT(*) >= 3
SELECT `T2`.`country` FROM `city` AS `T1` JOIN `country` AS `T2` ON `T1`.`country_id` = `T2`.`country_id` GROUP BY `T2`.`country_id` HAVING COUNT(*) >= 3
0.149414
CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING)
provide the age and religion of subject id 65652.
SELECT demographic.age, demographic.religion FROM demographic WHERE demographic.subject_id = "65652"
SELECT `demographic`.`age`, `demographic`.`religion` FROM `demographic` WHERE `65652` = `demographic`.`subject_id`
0.111328
CREATE TABLE table_name_67 (state STRING, region STRING, host STRING)
Which state contains the University of Iowa in the mideast region?
SELECT state FROM table_name_67 WHERE region = "mideast" AND host = "university of iowa"
SELECT `state` FROM `table_name_67` WHERE `host` = `university of iowa` AND `mideast` = `region`
0.09375
CREATE TABLE table_844 (`County` STRING, `Kerry #` FLOAT64, `Kerry %` STRING, `Bush #` FLOAT64, `Bush %` STRING, `Other #` FLOAT64, `Other %` STRING, `Total #` FLOAT64)
How many votes were cast in Wayne county?
SELECT MAX("Total #") FROM table_844 WHERE "County" = 'Wayne'
SELECT MAX(`Total #`) FROM `table_844` WHERE `County` = 'Wayne'
0.061523
CREATE TABLE table_39519 (`Source` STRING, `Date` STRING, `DeSUS` STRING, `Zares` STRING, `NLPD` STRING)
What is the source for Zares at 8.6%?
SELECT "Source" FROM table_39519 WHERE "Zares" = '8.6%'
SELECT `Source` FROM `table_39519` WHERE `Zares` = '8.6%'
0.055664
CREATE TABLE procedures (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE diagnoses (subject_id STRING, hadm_id STRING, icd9_code STRING, short_title STRING, long_title STRING) CREATE TABLE demographic (subject_id STRING, hadm_id STRING, name STRING, marital_status STRING, age STRING, dob STRING, gender STRING, language STRING, religion STRING, admission_type STRING, days_stay STRING, insurance STRING, ethnicity STRING, expire_flag STRING, admission_location STRING, discharge_location STRING, diagnosis STRING, dod STRING, dob_year STRING, dod_year STRING, admittime STRING, dischtime STRING, admityear STRING) CREATE TABLE lab (subject_id STRING, hadm_id STRING, itemid STRING, charttime STRING, flag STRING, value_unit STRING, label STRING, fluid STRING) CREATE TABLE prescriptions (subject_id STRING, hadm_id STRING, icustay_id STRING, drug_type STRING, drug STRING, formulary_drug_cd STRING, route STRING, drug_dose STRING)
How many patients having the procedure titled thoracentesis had a lab test category of blood gas?
SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id INNER JOIN lab ON demographic.hadm_id = lab.hadm_id WHERE procedures.long_title = "Thoracentesis" AND lab."CATEGORY" = "Blood Gas"
SELECT COUNT(DISTINCT `demographic`.`subject_id`) FROM `demographic` JOIN `lab` ON `Blood Gas` = `lab`.`category` AND `demographic`.`hadm_id` = `lab`.`hadm_id` JOIN `procedures` ON `Thoracentesis` = `procedures`.`long_title` AND `demographic`.`hadm_id` = `procedures`.`hadm_id`
0.270508
CREATE TABLE table_4676 (`Date` STRING, `Venue` STRING, `Score` STRING, `Result` STRING, `Competition` STRING)
Which match was played on April 2, 2006?
SELECT "Competition" FROM table_4676 WHERE "Date" = 'april 2, 2006'
SELECT `Competition` FROM `table_4676` WHERE `Date` = 'april 2, 2006'
0.067383
CREATE TABLE table_34194 (`Club` STRING, `Nickname` STRING, `Years in Competition` STRING, `No. of Premierships` FLOAT64, `Premiership Years` STRING)
What was the Premiership Years that had in the Competition of 1983-1992?
SELECT "Premiership Years" FROM table_34194 WHERE "Years in Competition" = '1983-1992'
SELECT `Premiership Years` FROM `table_34194` WHERE `Years in Competition` = '1983-1992'
0.085938
CREATE TABLE table_204_543 (id NUMERIC, `national team` STRING, `title ( s ) \ represented` STRING, `first\ worn` NUMERIC, `number\ of stars` NUMERIC, `notes` STRING)
germany first wore them in 1996 . who was next ?
SELECT "national team" FROM table_204_543 WHERE "first\nworn" > (SELECT "first\nworn" FROM table_204_543 WHERE "national team" = 'germany') ORDER BY "first\nworn" LIMIT 1
SELECT `national team` FROM `table_204_543` WHERE `first worn` > (SELECT `first worn` FROM `table_204_543` WHERE `national team` = 'germany') ORDER BY `first worn` LIMIT 1
0.166992
CREATE TABLE table_66704 (`Year` STRING, `Births ( 000s ) ` FLOAT64, `Deaths` FLOAT64, `Natural Growth` FLOAT64, `Total Fertility Rate` STRING)
What was the amount of deaths that had a natural growth smaller than 3.4, and a total fertility rate of 1.63?
SELECT "Deaths" FROM table_66704 WHERE "Natural Growth" < '3.4' AND "Total Fertility Rate" = '1.63'
SELECT `Deaths` FROM `table_66704` WHERE `Natural Growth` < '3.4' AND `Total Fertility Rate` = '1.63'
0.098633